Welcome to WebmasterWorld Guest from 54.162.248.199

Forum Moderators: bakedjake

Message Too Old, No Replies

Help with Crontab

Using Date Variable

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

10+ Year Member



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)

5+ Year Member



Try adding back quote to date varable:

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

Milan

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

10+ Year Member



Thanks milanmk,

That got it.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month