lords, I had to do something like this for a chat, growlhlhlhlhlhlhl for the same reason, too many log files being generated. but its been years and years since I worked on that, and I wasn't the bloke who wrote the code, just the idea man...
hmmmm, I also remember that there were references on eliminating unwanted logs by date in the bots files, a bot in this reference being a automated code beacon that generally kept a room on an irc chat open and provided minimal services to the chat users, if someone can't give you a direct line on this, you might take a look at the irc bots for some code that might inspire you!
sorry, best I can give at this time, elf Owner: Alacorn Computer Enterprises Specialists in customized computers and peripherals - own the might and majesty of a Alacorn! www.alacorncomputer.com proprietor, The Grab Bag, for blind computer users and programmers http://grabbag.alacorncomputer.com----- Original Message ----- From: "Lafond, Eileen" <Eileen.Lafond@xxxxxxxxxxx>
To: <programmingblind@xxxxxxxxxxxxx> Sent: Friday, June 25, 2010 3:29 PM Subject: A unix cron job questionWe run many cron jobs daily that create a log file per cron job. This creates many log files over time. I think that we have about 33000 files right now.
I am trying to create a cron job that will run once a month and delete all the log files that are more than thirty days out.
I am trying now just to put the specification document together and I am having a difficult time with the details of the code.
I was thinking of using the following: mydate="`date +"%m%d%y%H%M""I cannot figure out how to write the code to go thirty days back and when I get that, I will then create a delete statement to delete the rest of the files.
Does anyone have any idea as to how I can use the mydate above to figure out thirty days bac?
Or am I doing this the wrong way and there might be an easier way to do it? Thanks for any help. Eileen La Fond Work Phone: (206) 386-0011 Email: Eileen.lafond@xxxxxxxxxxx __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind __________View the list's information and change your settings at //www.freelists.org/list/programmingblind