cron job not running
Helmut Schneider
jumper99 at gmx.de
Tue May 29 16:06:47 UTC 2012
Hi,
if I put this into /etc/crontab:
* * * * * root aptitude -syV
safe-upgrade | grep -E '^\s+.*$'"
nothing happens. If I run the same command from dash:
~$ aptitude -syV safe-upgrade | grep -E '^\s+.*$'
libsnmp-base [5.4.2.1~dfsg0ubuntu1-0ubuntu2.1 ->
5.4.2.1~dfsg0ubuntu1-0ubuntu2.2]
libsnmp15 [5.4.2.1~dfsg0ubuntu1-0ubuntu2.1 ->
5.4.2.1~dfsg0ubuntu1-0ubuntu2.2]
libssl0.9.8 [0.9.8k-7ubuntu8.11 -> 0.9.8k-7ubuntu8.13]
libxml2 [2.7.6.dfsg-1ubuntu1.4 -> 2.7.6.dfsg-1ubuntu1.5]
openssl [0.9.8k-7ubuntu8.11 -> 0.9.8k-7ubuntu8.13]
snmp [5.4.2.1~dfsg0ubuntu1-0ubuntu2.1 ->
5.4.2.1~dfsg0ubuntu1-0ubuntu2.2]
snmpd [5.4.2.1~dfsg0ubuntu1-0ubuntu2.1 ->
5.4.2.1~dfsg0ubuntu1-0ubuntu2.2]
~$
Even if I put those line into a shell-script (dash) it does not give
any output.
According to cron.log the job should have run:
May 29 17:36:01 desoggw05 CRON[22700]: pam_unix(cron:session): session
opened for user root by (uid=0)
May 29 17:36:01 desoggw05 CRON[22701]: (root) CMD (aptitude -syV
safe-upgrade | grep -E '^\s+.*$')
May 29 17:36:02 desoggw05 CRON[22700]: pam_unix(cron:session): session
closed for user root
If I change the REGEX to '^ +.*$' the script runs fine.
Why?
Tested on 10.04 und 12.04.
Thanks, Helmut
More information about the ubuntu-users
mailing list