Skip to content

Instantly share code, notes, and snippets.

@coseos
Created August 4, 2022 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coseos/2afd15c71d62693f9dd6cbd8f85af41b to your computer and use it in GitHub Desktop.
Save coseos/2afd15c71d62693f9dd6cbd8f85af41b to your computer and use it in GitHub Desktop.

Linux crontab shortcuts

With cron, you can use some shortcuts that let you see when an entry is triggered without remembering the more difficult numbers that you would have to put there:

Synonym        Meaning and equivalent crontab values
-----------    ---------------------------------------------------
@reboot        Run once, at startup (only works with this synonym)
@yearly        Run once a year, equals "0 0 1 1 *".
@annually      (same as @yearly)
@monthly       Run once a month, equals "0 0 1 * *".
@weekly        Run once a week, equals "0 0 * * 0".
@daily         Run once a day, equals "0 0 * * *".
@midnight      (same as @daily)
@hourly        Run once an hour, equals "0 * * * *".

Keep in mind that you can fine tune the time a script is run by cron with numeric values. These shortcuts are just easier to remember.

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