Cronjob не работает, хотя запущен процесс cron - PullRequest
0 голосов
/ 25 октября 2019

Я настроил очень простое задание cron, но оно не работает.

$ crontab -e

* * * * * /usr/bin/env > /home/myid/env
* * * * * /bin/echo 'hi' > /home/myid/HI

Вышеуказанные задания вообще не работают. Путь / usr / bin / env и / bin / echo указаны правильно. Я вижу, что cron работает как процесс, и кажется, что root может выполнять задания cron.

$ ps aux |grep cron

root      2771  0.0  0.1   2316   860 ?        Ss   07:54   0:00 /usr/sbin/cron
myid     12232  0.0  0.1   2040   632 pts/1    S+   08:17   0:00 grep cron

$ tail -24 / var / log / syslog

Oct 25 08:01:08 localhost crontab[5224]: (myid) BEGIN EDIT (myid)
Oct 25 08:01:44 localhost init: Id "1" respawning too fast: disabled for 5 minutes
Oct 25 08:03:37 localhost crontab[5224]: (myid) END EDIT (myid)
Oct 25 08:05:01 localhost /USR/SBIN/CRON[7008]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 25 08:07:31 localhost sendmail[9090]: My unqualified host name (localhost) unknown; sleeping for retry
Oct 25 08:07:35 localhost init: Id "1" respawning too fast: disabled for 5 minutes
Oct 25 08:08:01 localhost /usr/sbin/cron[2771]: (*system*sendmail) RELOAD (/etc/cron.d/sendmail)
Oct 25 08:08:31 localhost sendmail[9090]: unable to qualify my own domain name (localhost) -- using short name
Oct 25 08:08:31 localhost sendmail[9090]: alias database /etc/mail/aliases rebuilt by root
Oct 25 08:08:31 localhost sendmail[9090]: /etc/mail/aliases: 12 aliases, longest 10 bytes, 134 bytes total
Oct 25 08:08:32 localhost sm-mta[9484]: My unqualified host name (localhost) unknown; sleeping for retry
Oct 25 08:08:34 localhost sm-msp-queue[9501]: My unqualified host name (localhost) unknown; sleeping for retry
Oct 25 08:09:32 localhost sm-mta[9484]: unable to qualify my own domain name (localhost) -- using short name
Oct 25 08:09:32 localhost sm-mta[9732]: starting daemon (8.14.4): SMTP+queueing@00:10:00
Oct 25 08:09:34 localhost sm-msp-queue[9501]: unable to qualify my own domain name (localhost) -- using short name
Oct 25 08:13:26 localhost init: Id "1" respawning too fast: disabled for 5 minutes
Oct 25 08:14:30 localhost crontab[11351]: (myid) BEGIN EDIT (myid)
Oct 25 08:15:01 localhost /USR/SBIN/CRON[11524]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Oct 25 08:16:21 localhost crontab[11351]: (myid) END EDIT (myid)
Oct 25 08:17:01 localhost /USR/SBIN/CRON[12193]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Oct 25 08:19:17 localhost init: Id "1" respawning too fast: disabled for 5 minutes
Oct 25 08:20:01 localhost /USR/SBIN/CRON[13206]: (smmsp) CMD (test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp)
Oct 25 08:20:02 localhost sm-msp-queue[13222]: My unqualified host name (localhost) unknown; sleeping for retry
Oct 25 08:21:02 localhost sm-msp-queue[13222]: unable to qualify my own domain name (localhost) -- using short name

$ статус службы cron

[ ok ] cron is running.

Указание переменной SHELL в началеcrontab тоже не был решением ..

SHELL=/bin/bash
* * * * * /usr/bin/env > /home/myid/env
* * * * * /bin/echo 'hi' > /home/myid/HI

Я действительно понятия не имею, почему он не работает. Любое предложение, пожалуйста?

...