tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* SUMMARY: Silly Cron/Script Questions
@ 2002-06-04 19:47 Skulley, William
  0 siblings, 0 replies; only message in thread
From: Skulley, William @ 2002-06-04 19:47 UTC (permalink / raw)


Very fast response on this one, and yes, a simple answer, right out of the
crontab man page:

  The cron program runs the command named in the sixth field at the
specified
  date and time.  If you include a percent sign (%) in the sixth field, cron
  treats everything that precedes it (in that field) as the command invoca-
  tion, and makes all that follows it available to standard input, unless
you
  escape the percent sign (\%) or double quote it ("%"). 

Working entry is:
45 13 * * * script.ksh arg1 -arg2.`date +\%y\%m\%d`

Thanks to Dr Blinn, Pat O'Brien, Martin Moore, Paul Sand, Ken Peacock, Dan
Harrington and George Gallen.

My apologies for asking a question so obviously documented.  

Bill


> -----Original Message-----
> From:	Skulley, William [SMTP:William.Skulley@rfets.gov]
> Sent:	Tuesday, June 04, 2002 1:30 PM
> To:	tru64-unix-managers@ornl.gov
> Subject:	Silly Cron/Script Questions
> 
> I have a cronjob:
> 
> 0 0 * * * script.ksh arg1 arg2.`date +%y%m%d`
> 
> arg2 is an output filename.  When run from cron, the file comes out
> "arg2."
> with no date information tacked on.  Running the exact same command line
> from a shell (sh) prompt gets the date information properly (filename
> arg2.020604).  I get the following mail from cron:
> 
> *************************************************
> Cron: The previous message is the standard output
>       and standard error of the following crontab command:
> 
> script.ksh arg1 arg2.`date +
> 
> 
> If I add double quotes and change the cron entry to:
> 
> 0 0 * * * "script.ksh arg1 arg2.`date +%y%m%d`"
> 
> the job does not run and I get the following mail from cron:
> 
> sh: script.ksh arg1 arg2.: not found
> 
> 
> *************************************************
> Cron: The previous message is the standard output
>       and standard error of the following crontab command:
> 
> "script.ksh arg1 arg2.`date +
> 
> 
> What am I missing?  I'm sure its something really obvious and silly but I
> can't for the life of me see it.
> 
> Thanks
> Bill Skulley


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-06-04 19:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-04 19:47 SUMMARY: Silly Cron/Script Questions Skulley, William

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox