好的,所以我已经制作了脚本,/etc/cron.hourly然后将其放入chmod 777文件中,但它不会(自动)运行。如果我手动运行它,它工作正常。我还需要做什么吗?
每小时我都会收到一封包含这样错误的电子邮件,
Subject: Cron <root@supa> root cd / && run-parts --report /etc/cron.hourly
/bin/sh: root: not found
Run Code Online (Sandbox Code Playgroud)
/etc/crontab 的内容如下,无论是否删除用户“root”(第 6 列),我都会收到相同的错误。
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
11 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * …Run Code Online (Sandbox Code Playgroud)