从系统日志
May 8 01:00:01 mvtspro-main /USR/SBIN/CRON[22645]: (root) CMD (/usr/local/ky4k0b/cdrs_backup_daily.sh)
May 8 01:00:01 mvtspro-main /USR/SBIN/CRON[22638]: (CRON) error (grandchild #22645 failed with exit status 12)
从 /etc/crontab
mvtspro-main:/cdrs/backup# cat /etc/crontab
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
25 6 * * * root ntpdate pool.ntp.org
0 1 * * * root /usr/local/ky4k0b/cdrs_backup_daily.sh
0 2 1 * * root /usr/local/ky4k0b/cdrs_backup_monthly.sh
0 3 1 * * root /usr/local/lib/mvtspro/backupdb.php
我的脚本
mvtspro-main:/cdrs/backup# cat /usr/local/ky4k0b/cdrs_backup_daily.sh
#!/bin/sh
mask=`date --date="yesterday" +%Y%m%d\*`
arch_name=`date --date="yesterday" +%Y%m%d`
find /cdrs -type f -name "$mask"|zip -m /cdrs/backup/$arch_name.zip -@
我在哪里做错了?谢谢!PS:如果我手动运行此脚本,它工作正常。