uninstall-cron - Remove Cron Jobs
The uninstall-cron command removes Update-Watcher cron jobs from the current user’s crontab. You can remove a specific job type or all Update-Watcher jobs at once.
Usage
Terminal
update-watcher uninstall-cron [--type TYPE] [--all]Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--type TYPE | string | check | Job type to remove: check or self-update. |
--all | bool | false | Remove all Update-Watcher cron jobs regardless of type. |
How It Works
When the install-cron command creates a cron entry, it includes an identifying comment for each job type:
Crontab
# update-watcher scheduled check
0 7 * * * /usr/local/bin/update-watcher run --quiet 2>&1 | logger -t update-watcher
# update-watcher self-update
0 3 * * 0 /usr/local/bin/update-watcher self-update 2>&1 | logger -t update-watcherThe uninstall-cron command:
- Reads the current user’s crontab.
- Searches for lines matching the comment marker for the specified job type (or all types with
--all). - Removes the comment line and the associated command line.
- Writes the updated crontab.
Examples
Remove the Check Job
Terminal
update-watcher uninstall-cronOutput
Update Check cron job removed successfully.Remove the Self-Update Job
Terminal
update-watcher uninstall-cron --type self-updateOutput
Self-Update cron job removed successfully.Remove All Jobs
Terminal
update-watcher uninstall-cron --allOutput
All update-watcher cron jobs removed.Verify Removal
After removing cron jobs, verify they are gone:
Terminal
crontab -lThe Update-Watcher entries should no longer appear in the output.
Dedicated Service User
If the cron jobs were installed under a dedicated system user, remove them with:
Terminal
sudo -u update-watcher update-watcher uninstall-cron --allOr edit the user’s crontab directly:
Terminal
sudo crontab -u update-watcher -eRelated
- install-cron – Install cron jobs for automated tasks.
- Cron Scheduling – Detailed cron scheduling guide.