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
Want to recreate my log files on server
Moderator: General Moderators
Re: Want to recreate my log files on server
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.
Let me know if this will work.
Re: Want to recreate my log files on server
Look into the log rotation daemon. It's purpose is to do exactly what you want.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.