第二种方案:更改系统级的crontab
1. 命令行输入:$sudo vim /etc/crontab
最后一行添加:* * * * * root bash /home/test/wanda_img_store/backends/bin/cron_worker.sh ,记得一定要添加user:root,否则不生效!
1 # /etc/crontab: system-wide crontab
2 # Unlike any other crontab you don't have to run the `crontab'
3 # command to install the new version when you edit this file
4 # and files in /etc/cron.d. These files also have username fields,
5 # that none of the other crontabs do.
6
7 SHELL=/bin/sh
8 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
9
10 #m h dom mon dow user command
11 17 * * * * root cd / &&