[WBEL-users] quick script help

Vincent.Raffensberger at dtn.com Vincent.Raffensberger at dtn.com
Thu Mar 31 12:02:05 CST 2005


You'd probably be better off adding it to logrotate, but this should work 
as a cronjob:
30 7 * * Mon-Fri                [ -f /var/log/mondo-archive.log ] && mv 
/root/backuplogs/mondo-archive.log.`date +%Y%m%d`
or this:
30 7 * * Mon-Fri                ( TODAYSDATE=`date +%Y%m%d`; [ -f 
/var/log/mondo-archive.log ] && mv 
/root/backuplogs/mondo-archive.log.$TODAYSDATE )




Erick Perez <eaperezh at gmail.com> 
Sent by: whitebox-users-bounces at beau.org
03/31/2005 11:22 AM
Please respond to
Erick Perez <eaperezh at gmail.com>


To
whitebox-users at beau.org
cc

Subject
[WBEL-users] quick script help






Hi there,  i need some help with a quick script (im not very good with
perl, still learning)

i want to run a cron at certain time in the morning and that cron should:
1- check for file named /var/log/mondo-archive.log
2- if exists move the file to 
/root/backuplogs/mondo-archive.log.TODAYSDATE

how do i extract todays date(format MMDDYY), save it into a variable
and then append it to the filename

thanks,
-- 

-------------------------------------------
Erick Perez
Linux User 376588
http://counter.li.org/  (Get counted!!!)
Panama, Republic of Panama
_______________________________________________
Whitebox-users mailing list
Whitebox-users at beau.org
http://beau.org/mailman/listinfo/whitebox-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://beau.org/pipermail/whitebox-users/attachments/20050331/e0f6d37b/attachment-0001.htm


More information about the Whitebox-users mailing list