LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 11-04-2003, 04:59 PM   #1
m3kgt
Member
 
Registered: Oct 2003
Location: WA
Distribution: Redhat 3.0ES & Slackware 8.1
Posts: 44

Rep: Reputation: 15
Anyway to lock apache log file before I tar the directory?


I am trying to create a backup of all my virtual websites. I made a little shell scrip that will tar all directories within a specified directory. Everything works fine except while I was running the script, somebody accessed one of my websites, which caused tar to crash since it was trying to tar the apache log file that changed right in the middle of the process.

Is there a way i can lock a file until I am done tarring the directory?
 
Old 11-05-2003, 07:41 AM   #2
sidey
Member
 
Registered: Mar 2003
Location: Essex UK
Distribution: rh 8.0 bsd 5.0 slack 9.0 rc2 crux
Posts: 147

Rep: Reputation: 15
/location/to/apache/bin/apachectl stop, ok you might have a few mins down time, but i am sure a few mins is better than if you lose everything and have to spend weeks redo ing all the stuff
 
Old 11-05-2003, 11:51 AM   #3
m3kgt
Member
 
Registered: Oct 2003
Location: WA
Distribution: Redhat 3.0ES & Slackware 8.1
Posts: 44

Original Poster
Rep: Reputation: 15
stop is not an option. I have about 300 websites running on our main server. This is a production, commercial, enviroment. I am sure I would get a few calls if all of the sudden their sites went down for 10 minutes while I ran the script.

I'll just wait until the middle of the night and hope nobody access the website I am tarring at the exact second I am tarring it.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 03:15 AM
apache .htaccess and htpasswd - can't lock directory jordanthompson Linux - Software 9 02-07-2005 11:12 PM
tar -zvf file.gz in which directory to open? solutionseeker Linux - Newbie 3 01-30-2005 01:31 AM
[SOLVED] Apache log directory permissions gypsy_rabbi Linux - Security 2 10-09-2004 06:31 PM
Amsn log in-no file or directory? Cliff Fussell Linux - Newbie 2 01-15-2004 05:16 PM


All times are GMT -5. The time now is 09:13 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration