Source: medium.com

Cron Examples

Category: Database

How to write a crontab schedule expression for:“At every minute.”* * * * * At every 2nd minute from 1 through 59.1–59/2 * * * *

For example, if you need to run X every 90 minutes, create one crontab entry that runs X every 3 hours on the hour (0 */3 * * *), and a second crontab entry that runs X every 3 hours with an offset (30 1/3 * * *).

If you wanted the mail not to be sent to anywhere, i.e to stop the crontab output to be emailed, add or update the MAIL variable in the crontab as shown below.

For example, instead of specifying /home/test/tape-backup, if you want to just specify tape-backup, then add the path /home/test to the PATH variable in the crontab as shown below.

Related Articles