[WBEL-users] quick script help

Erick Perez eaperezh at gmail.com
Fri Apr 1 13:00:47 CST 2005


I see i was missing the '  in the variable setup. thanks,


On Mar 31, 2005 5:28 PM, John Morris <jmorris at beau.org> wrote:
> On Thu, 2005-03-31 at 11:22, Erick Perez wrote:
> 
> > 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
> 
> Sure you aren't reinventing the wheel?  Can logrotate do what you need?
> 
> > how do i extract todays date(format MMDDYY), save it into a variable
> > and then append it to the filename
> 
> Don't have my camel book here but wouldn't $timestamp=`date +%Y%m%d` do
> the trick?  You do want yyyymmdd so directory listings will sort in date
> order right?  And lets not go repeating the Y2K mess and keep using two
> digit years again, but if you insist just make the Y a small one.  :)
> 
> --
> John M.      http://www.beau.org/~jmorris     This post is 100% M$Free!
> Geekcode 3.1:GCS C+++ UL++++$ P++ L+++ W++ w--- Y++ b++ 5+++ R tv- e* r
> 
> _______________________________________________
> Whitebox-users mailing list
> Whitebox-users at beau.org
> http://beau.org/mailman/listinfo/whitebox-users
> 


-- 

-------------------------------------------
Erick Perez
Linux User 376588
http://counter.li.org/  (Get counted!!!)
Panama, Republic of Panama


More information about the Whitebox-users mailing list