Há alguns dias, adicionei um cronjob usando crontab -e
, que deve ser executado a cada 6 horas. No entanto, notei que a tarefa do cron não está funcionando. Quando eu executo meu script manualmente ele funciona, e ele deve gravar alguns dados em um arquivo para que eu saiba se funciona ou não. Para descobrir o que está errado, executei este comando: service cron status
e recebi isto:
Redirecting to /bin/systemctl status cron.service
● cron.service
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
Quando executo service cron start
, obtenho isto:
Redirecting to /bin/systemctl start cron.service
Failed to start cron.service: Unit cron.service failed to load: No such file or directory.
Alguém pode me dar uma dica do que fazer aqui, eu não sou especialista nisso.
Obrigado
EDITAR:
Saída de service crond status
:
Redirecting to /bin/systemctl status crond.service
● crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; vendor preset: enabled)
Active: active (running) since Pet 2016-05-13 13:46:20 EDT; 1 weeks 3 days ago
Main PID: 26127 (crond)
CGroup: /system.slice/crond.service
└─26127 /usr/sbin/crond -n
Maj 13 13:46:20 host systemd[1]: Started Command Scheduler.
Maj 13 13:46:20 host systemd[1]: Starting Command Scheduler...
Maj 13 13:46:20 host crond[26127]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 88% if used.)
Maj 13 13:46:20 host crond[26127]: (CRON) INFO (running with inotify support)
Maj 13 13:46:20 host crond[26127]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Maj 17 13:49:01 host crond[26127]: (root) RELOAD (/var/spool/cron/root)
Maj 17 13:52:01 host crond[26127]: (mailman) RELOAD (/var/spool/cron/mailman)
Maj 24 10:06:01 host crond[26127]: (root) RELOAD (/var/spool/cron/root)
EDIT2:
Saída de crontab -l
:
0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
30 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&1
2,58 * * * * /usr/local/bandmin/bandmin
0 0 * * * /usr/local/bandmin/ipaddrmap
46 13 * * * /usr/local/cpanel/scripts/upcp --cron
40 2 * * * /usr/local/cpanel/scripts/cpbackup
23 21 * * * /usr/local/cpanel/bin/backup
35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check
45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache && /usr/local/cpanel/scripts/update_mailman_cache
30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
30 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1
15 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&1
15 */6 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1
*/5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1
37 4 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
13,28,43,58 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
19 4 * * * /usr/local/cpanel/3rdparty/bin/freshclam --quiet --no-warnings
0 */6 * * * /usr/bin/php /home/legacy/EssentricTools/src/index.php migrate:sync -c prod
Meu comando é o último