Skip to content

Instantly share code, notes, and snippets.

@naumvd95
Last active January 17, 2018 14:21
Show Gist options
  • Save naumvd95/820c5def4a349c5b9d013ad3e47a2021 to your computer and use it in GitHub Desktop.
Save naumvd95/820c5def4a349c5b9d013ad3e47a2021 to your computer and use it in GitHub Desktop.
remove duplicating jobs from crontab
crontab -l | sort -u | crontab -
@naumvd95
Copy link
Author

naumvd95 commented Jan 17, 2018

root@cid01:~# crontab -l

 Lines below here are managed by Salt, do not edit
# SALT_CRON_IDENTIFIER:aptly_mirror_update
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
* * * * * /bin/cronjobCommandYouWant >> /dev/null 2>&1
* * * * * /bin/cronjobCommandYouWant >> /dev/null 2>&1
* * * * * /bin/cronjobCommandYouWant >> /dev/null 2>&1
* * * * * /bin/cronjobCommandYouWant >> /dev/null 2>&1
* * * * * /bin/cronjobCommandYouWant >> /dev/null 2>&1
* * * * * /bin/cronjobCommandYouWant >> /dev/null 2>&1
0 */12 * * * /usr/local/bin/aptly_mirror_update.sh -s

root@cid01:~# crontab -l | sort -u | crontab -

root@cid01:~# crontab -l

# Lines below here are managed by Salt, do not edit
# SALT_CRON_IDENTIFIER:aptly_mirror_update
* * * * * /bin/cronjobCommandYouWant >> /dev/null 2>&1
0 */12 * * * /usr/local/bin/aptly_mirror_update.sh -s
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment