Home » Infrastructure » Unix » crontab(le) error.
crontab(le) error. [message #220150] Mon, 19 February 2007 03:42 Go to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Hi,

I am having entry like below in the cron table

50 12 * * * echo "Welcome xyz `date '+%d/%m/%y %A'`" >> /export/home/xyz/test_cron.txt 2>&1

instead of creating file called test_cron.txt, it is coming as a mail...
please help in this Sad

SunOs 5.8
xyx entry is present in this file
/usr/lib/cron/cron.allow

Thanks.
Re: crontab(le) error. [message #220434 is a reply to message #220150] Tue, 20 February 2007 12:41 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Try setting up the environment so it knows where echo and date are:

50 12 * * * . ~/my_cron_env; echo "Welcome xyz `date '+%d/%m/%y %A'`" >> /export/home/xyz/test_cron.txt 2>&1
Re: crontab(le) error. [message #220555 is a reply to message #220150] Wed, 21 February 2007 04:27 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Thanks for your suggestion...
In that case let us say i am giving the entire path of the command like

50 12 * * * /usr/bin/echo "Welcome xyz `/usr/bin/date '+%d/%m/%y %A'`" >> /export/home/xyz/test_cron.txt 2>&1

it should work right? but it didn't.

Thanks.

Re: crontab(le) error. [message #221191 is a reply to message #220150] Sat, 24 February 2007 23:52 Go to previous messageGo to next message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Hi.
Can you please assist in this?

Thanks,
Shahnaz.
Re: crontab(le) error. [message #221212 is a reply to message #220150] Sun, 25 February 2007 08:46 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
first make work, then make it fancy

What does "crontab -l" produce?

What does the following produce from the command line?
/usr/bin/echo "Welcome xyz `/usr/bin/date '+%d/%m/%y %A'`" >> /export/home/xyz/test_cron.txt 2>&1


Re: crontab(le) error. [message #221246 is a reply to message #221212] Sun, 25 February 2007 23:36 Go to previous message
shahnazurs
Messages: 240
Registered: June 2005
Location: India
Senior Member
Hi.
It is working perfectly if i execute the command, when i do the same in cron table, it is not working.

Thanks,
Shahnaz
Previous Topic: Mailx - Concurrency and State of Mail
Next Topic: LogADM
Goto Forum:
  


Current Time: Thu Mar 28 13:53:52 CDT 2024