| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Pubcon Platinum Sponsor 2014|
|rotation + date in file name with crontab shellscript|
A friend asked me this:
I need to create a command for crontab containing this:
'cp access.log xxxxxx.log' where xxxxxx represents the output from date
in any format, preferably YYMMDD or YYYYMMDD.
I will set crontab to execute this daily at 23:59:59 saving the day's
access log before it is replaced at 00:00:00
Think you could steer me the right way here?
Now, I could do this with a perl/shell combo, but how would one write a script to do this in straight shell?
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved