Cron Ubuntu [FAST]

30 4 1,15 * * runs at 4:30 AM on the 1st and 15th. 3. Using Special Shortcuts

Ubuntu supports convenient shorthand "aliases" for common intervals, which replace the five-star syntax entirely: @reboot : Runs once right after the system boots up. @daily : Runs once a day at midnight (same as 0 0 * * * ). @weekly : Runs once a week on Sunday (same as 0 0 * * 0 ). @monthly : Runs once a month (same as 0 0 1 * * ). 4. Step-by-Step: Creating Your First Job To create a custom cron job on Ubuntu: cron ubuntu

For complex scheduling needs, tools like Crontab.guru can help you visualize and verify your syntax before applying it to your server. 30 4 1,15 * * runs at 4:30 AM on the 1st and 15th

: By default, cron sends output to local mail. To see errors easily, redirect them to a file: * * * * * /path/to/cmd >> /var/log/myjob.log 2>&1 . @daily : Runs once a day at midnight (same as 0 0 * * * )

: Scroll to the bottom of the file and add your line. For example, to log the date every minute: * * * * * date >> /tmp/cron_test.log

: In Nano, press Ctrl+O then Enter to save, and Ctrl+X to exit.

Scroll to Top