homepage Welcome to WebmasterWorld Guest from 54.166.108.167
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Help with Crontab
Using Date Variable
Moff




msg:3300096
 3:08 pm on Apr 2, 2007 (gmt 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]

 

milanmk




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

Try adding back quote to date varable:

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

Milan

Moff




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

Thanks milanmk,

That got it.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved