cron job not running



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


--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users



Relevant Pages

  • Re: cron job not running
    ... If I run the same command from dash: ... Even if I put those line into a shell-script (dash) it does not ... session closed for user root ... If I change the REGEX to '^ +.*$' the script runs fine. ...
    (Ubuntu)
  • Re: cron job not running
    ... If I run the same command from dash: ... Even if I put those line into a shell-script (dash) it does not give ... session closed for user root ... Yeah, checking the mails, the same that arrive when I cahnge the REGEX. ...
    (Ubuntu)
  • Re: cron job not running
    ... If I run the same command from dash: ... Even if I put those line into a shell-script (dash) it does not give ... closed for user root ...
    (Ubuntu)
  • Re: Why cannot I find the Symbol dialog box in the Insert menu?
    ... Charles has told you how to restore the command; I will tell you how you ... You wanted to insert an em dash. ... ToolsCustomizeRemoveMenuShortcut is to remove any menu item you click on. ... Word MVP FAQ site: http://word.mvps.org ...
    (microsoft.public.word.docmanagement)
  • Re: [semi-OT] How to echo \ in dash
    ... In an effort to write my scripts in a posix conform way, ... dash instead of bash. ... Per the POSIX and SUS specifications, the echo command, which maybe be ...
    (Debian-User)