如何在 Linux 中安排 cron 作业?

dis*_*sha 1 linux cron date

我有脚本文件。.file 我只需要在每个月的第一天运行。

我怎样才能用我的 cron 作业做到这一点?

52 07 * * * bash '/home/linux/tanu/cat.sh'
Run Code Online (Sandbox Code Playgroud)

Fre*_*ddy 5

# * * * * *
# | | | | |
# | | | | day of week 0-7 (0 or 7 is Sun, or use names)
# | | | month 1-12 (or names)
# | | day of month 1-31
# | hour 0-23
# minute 0-59 

# runs on every 1st of month at 7:52am
52 7 1 * * bash '/home/linux/tanu/cat.sh'    

# runs on all other days at 7:52am
52 7 2-31 * * bash '/home/linux/tanu/cat.sh'     
Run Code Online (Sandbox Code Playgroud)

我希望这是正确的。

  • 相关:[Crontab Guru 链接](https://crontab.guru/#52_7_1_*_*) (3认同)