Re: cron problem

From: Bill Thompson (bill.thompson@GOODYEAR.COM)
Date: Mon Apr 14 2003 - 10:54:50 EDT


Holger,

This comes up from time to time. The percent sign has special meaning to
cron.

>From the crontab man page:

The cron daemon runs the command named in the sixth field at the selected
date
and time. If you include a % (percent sign) in the sixth field, the cron
daemon
treats everything that precedes it as the command invocation and makes all
that
follows it available to standard input, unless you escape the percent sign
(\%).
Blank lines and lines whose first non-blank character is the number sign
(#)
will be ignored.

Add a backslash before the percent signs in your crontab entry.

Bill Thompson
Sr UNIX Systems Administrator
The Goodyear Tire & Rubber Co.

Contains Confidential and/or Proprietary Information
May Not Be Copied or Disseminated Without Express Consent of The Goodyear
Tire & Rubber Company.

AIX-L Archives: http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2

 ----- Original Message -----
 From: Holger.VanKoll@SWISSCOM.COM
 Newsgroups: bit.listserv.aix-l
 To: aix-l@Princeton.EDU
 Sent: Monday, April 14, 2003 9:20 AM
 Subject: cron problem

 Hello,

 when called from cron, this command only gives me a mail message
 containing "Mon Apr 14 15:15:00 DFT 2003". /perflog/iostat is not
 created/touched.

 That looks like the date-command is executed without the +%d etc.
 parameters and no io-redirection is done.

 From the shell, it works. Why?

 0,30 * * * * /usr/bin/ksh -c '/usr/bin/iostat -s|grep -p System|grep -v
 ^$|tail -1|read a a r w; echo `/usr/bin/date "+%d%m%y:%H%M"`:$r:$w
>>/perflog/iostat'

 Called from at , it works:
 echo '/usr/bin/iostat -s|grep -p System|grep -v ^$|tail -1|read a a r w;
 echo `/usr/bin/date "+%d%m%y:%H%M"`:$r:$w >>/perflog/iostat'|at 15:12

 This created /perflog/iostat and put the values in.

 Regards,

 Holger



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:44 EDT