crontab jojo's blog--快乐忧伤都与你同在 BlogJava

crontab - jojo's blog--快乐忧伤都与你同在 - BlogJava

Once inside the editor, you will want to refer to the fields above in order to schedule a cron job for the appropriate time. Here are some examples:

*/5 * * * * /home/adam/script.sh will execute script.sh every 5 minutes. This will set crontab every 5 minutes.
59 23 * * 1-5 /home/adam/script.sh will execute script.sh every day, monday through friday, at 11:59 p.m.
0 0 * * 0 /home/adam/script.sh will execute script.sh once a week. You could also specify @weekly instead of 0 0 * * 0.

0 23 1 * * /home/adam/script.sh will execute script.sh once a month, on the first, at 11:00 PM. You could also specify @monthly in place of 0 23 1 * *.

原文地址:https://www.cnblogs.com/lexus/p/2799513.html