我正在试图弄清楚如何在每个星期天运行crontab作业。我认为以下应该可以工作,但我不确定我是否理解正确。以下内容正确吗?
5 8 * * 6
我正在试图弄清楚如何在每个星期天运行crontab作业。我认为以下应该可以工作,但我不确定我是否理解正确。以下内容正确吗?
5 8 * * 6
当前回答
10 * * *太阳
Position 1 for minutes, allowed values are 1-60
position 2 for hours, allowed values are 1-24
position 3 for day of month ,allowed values are 1-31
position 4 for month ,allowed values are 1-12
position 5 for day of week ,allowed values are 1-7 or and the day starts at Monday.
其他回答
* * * * 0
you can use above cron job to run on every week on sunday, but in addition on what time you want to run this job for that you can follow below concept :
* * * * * Command_to_execute
- � � � -
| | | | |
| | | | +�� Day of week (0�6) (Sunday=0) or Sun, Mon, Tue,...
| | | +���- Month (1�12) or Jan, Feb,...
| | +����-� Day of month (1�31)
| +������� Hour (0�23)
+��������- Minute (0�59)
@每周工作对我更好! 例如,添加crontab -e,它将在每个周日0:00 AM工作 @weekly /root/fd/databasebackup/week.sh >> ~/test.txt
10 * * *太阳
Position 1 for minutes, allowed values are 1-60
position 2 for hours, allowed values are 1-24
position 3 for day of month ,allowed values are 1-31
position 4 for month ,allowed values are 1-12
position 5 for day of week ,allowed values are 1-7 or and the day starts at Monday.
crontab网站提供了实时结果显示:https://crontab.guru/#5_8_*_*_0
我想你会喜欢这个交互式网站,它经常帮助我构建复杂的Crontab指令:https://crontab.guru/