Page 1 of 1

Want to recreate my log files on server

Posted: Tue Apr 26, 2011 6:55 am
by djdon11
Hello All,

I have certain cron running on my server and the script runs with these cron actually creates some log files on server with certain data. As the cron goes on these log files goes to heavy. Now what i want that after having a certain amount of data the log file should recreated instead of updating the same. Do any buddy having such idea to recreate the log files automatically on the server?

Thanks in advance

Re: Want to recreate my log files on server

Posted: Wed Apr 27, 2011 4:24 am
by prensil
You can run another cron to move the log file with some file size condition. Then you can run touch command to create the exact file with same name at the original location.
Let me know if this will work.

Re: Want to recreate my log files on server

Posted: Wed Apr 27, 2011 12:49 pm
by pickle
Look into the log rotation daemon. It's purpose is to do exactly what you want.