繁体   English   中英

crontab:同一脚本仅在一天触发

[英]crontab: same script is triggered only on one day

我不是 linux 专家,需要一些对 crontab 之谜的支持(对我而言)。 我想每周两次备份我的树莓派。 这是同一个脚本。 但只有每周一的触发器 (dow=1) 会执行。 星期五规则 (dow=5) 什么都不做 - 没有保存备份。 我不明白为什么。 怎么了? 我在哪里可以找出问题所在?

# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
0 4 * * 1 /home/pi/Backup/backup.sh > /dev/null
0 4 * * 5 /home/pi/Baclup/backup.sh > /dev/null

crontab -e 截图

你做的一切都是正确的。 您只是错过了第二双眼睛,发现您在第二行中有错字:

BaclupBackup

;-)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM