Welcome to WebmasterWorld Guest from 54.145.213.148

Forum Moderators: bakedjake

Message Too Old, No Replies

Help with Crontab

Using Date Variable

     
3:08 pm on Apr 2, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 21, 2004
posts:48
votes: 0


Hi, Im trying to setup a cron job to download a set of log files on the 1st of every month though I can't seem to get it to work using a date variable. Am currently using:

0 10 1 * * lynx -dump -auth=user:pass http://www.example.com/subdirectory/$(date '+\%d\%m\%Y').zip > /home/user/logfiles/$(date '+\%d\%m
\%Y').zip

The files im trying to download are in the format:

01 February 2007 01022007.zip
01 March 2007 01032007.zip
01 April 2007 01042007.zip

Can anyone suggest where I might be going wrong?

Cheers

[edited by: Moff at 3:17 pm (utc) on April 2, 2007]

6:50 pm on Apr 2, 2007 (gmt 0)

Full Member

10+ Year Member

joined:Jan 4, 2006
posts:307
votes: 0


Try adding back quote to date varable:

`date '+\%d\%m\%Y'`

Milan

11:26 am on Apr 3, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 21, 2004
posts:48
votes: 0


Thanks milanmk,

That got it.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members