Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 11-04-2003, 05:59 PM   #1
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, 08:41 AM   #2
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, 12:51 PM   #3
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.


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 04:15 AM
apache .htaccess and htpasswd - can't lock directory jordanthompson Linux - Software 9 02-08-2005 12:12 AM
tar -zvf file.gz in which directory to open? solutionseeker Linux - Newbie 3 01-30-2005 02:31 AM
[SOLVED] Apache log directory permissions gypsy_rabbi Linux - Security 2 10-09-2004 07:31 PM
Amsn log in-no file or directory? Cliff Fussell Linux - Newbie 2 01-15-2004 06:16 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:15 PM.

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