Taking back up of log file for running process/
I am working in HP UNIX
I have one process which is runnuing continusly.There is log file generated for the process. I want to take back up of file without loosing any logs after perticular interval of time or say file size increases more that 1GB. what can be possible solution? |
Set up a cron job with the correct privileges to move and rename the existing log once a day to a backup log. Then touch a new log file.
You don't say what the process is, is there a facility to specify maximum log file size ? Have a look how other log files are handled and copy the format. regards Alan |
Its a JVM process generating sysout.log
can u please explain me how can i set crons?. |
I suggest you check out
Code:
man -a crontab Basically you write a shell script to copy and rename your file, and use crontab to run that script as specific times. I can't help much more than that, because there are details about the job I don't know. Things to consider - Has the JVM got a lock on the log file preventing any other access while it's running ? When is the quietest time to do the change ? How long are you going to keep the backups ? etc. |
All times are GMT -5. The time now is 11:07 PM. |