LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-16-2010, 12:52 AM   #1
route
LQ Newbie
 
Registered: Feb 2009
Posts: 22

Rep: Reputation: 0
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?
 
Old 02-17-2010, 08:16 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
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
 
Old 02-17-2010, 11:44 PM   #3
route
LQ Newbie
 
Registered: Feb 2009
Posts: 22

Original Poster
Rep: Reputation: 0
Its a JVM process generating sysout.log
can u please explain me how can i set crons?.
 
Old 02-18-2010, 05:15 AM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 249Reputation: 249Reputation: 249
I suggest you check out
Code:
man -a crontab
on your system for accurate details of your crontab set up.
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
want to make Log of system calls per process running on the machine sudhansu Linux - Kernel 7 02-16-2012 02:50 AM
[SOLVED] [bash]Pick up process running in back up by another terminal... RaptorX Linux - General 5 09-02-2009 01:29 PM
Deleted log file - how to get back via file descriptor and keep alive? prollocks Linux - General 1 05-29-2009 09:08 AM
what is command to display the process which is running in the back ground vinaykori Linux - General 2 02-07-2008 09:35 PM
how to backup & truncate the log file while the process is running mvenkat_in Programming 13 10-30-2007 07:03 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration