LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-04-2009, 02:43 PM   #1
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Rep: Reputation: 46
TAR'ing a directory that's possibly in use?


I want to make a TAR of a directory we have that is shared out with samba, but there may be some users using a couple files on it. Will this cause any issues TAR'ing the whole thing now? will it just skip the files that are opened by users? it's only a few files, and i really want to get a TAR file as a backup of how it is now.

Last edited by rjo98; 09-04-2009 at 02:43 PM. Reason: proper grammer
 
Old 09-04-2009, 02:48 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,926

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by rjo98 View Post
I want to make a TAR of a directory we have that is shared out with samba, but there may be some users using a couple files on it. Will this cause any issues TAR'ing the whole thing now? will it just skip the files that are opened by users? it's only a few files, and i really want to get a TAR file as a backup of how it is now.
No, it won't skip them, but it might cause corruption in the file when you go to open it later. Tar will just get what's there now, and make it's best attempt to archive the data as is.

It won't damage what's there if someone has it open, but may not restore correctly later.
 
Old 09-04-2009, 02:49 PM   #3
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Corruption as in my TAR file would be totally useless, or just those couple open files might not extract right?
 
Old 09-04-2009, 02:52 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
A solution is to put the directory on an LVM volume and then use an LVM snapshot. That way you get a consistent backup at a point in time and can restore the files as they were at that time.
 
Old 09-04-2009, 03:01 PM   #5
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
I usually use a TAR then GZIP cron job, but i needed a more immediate, fresh backup for something. can't really move this shared volume to another server with LVM.
 
Old 09-04-2009, 04:23 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 17,926

Rep: Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690Reputation: 3690
Quote:
Originally Posted by rjo98 View Post
Corruption as in my TAR file would be totally useless, or just those couple open files might not extract right?
Just those files, and they MAY be ok, but you can't know for sure, until you restore them.
 
Old 09-04-2009, 04:25 PM   #7
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
OK, thanks for clarifying. is there a way to tell what files are even open within a directory through Samba at a given time?
 
Old 09-04-2009, 05:07 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by rjo98 View Post
OK, thanks for clarifying. is there a way to tell what files are even open within a directory through Samba at a given time?
Even if there were, the "given time" is not precise enough because you don't know when tar is backing up specific files. A simpler and more do-able approach might be to script restoring the files to somewhere else and compare their checksums with the original files. If any did not match you could do whatever was necessary -- perhaps simply note that those files are not backed up or add them to the archive (and then repeat if they may still be changing).
 
Old 09-04-2009, 05:10 PM   #9
rjo98
Senior Member
 
Registered: Jun 2009
Location: US
Distribution: RHEL, CentOS
Posts: 1,668

Original Poster
Rep: Reputation: 46
Thanks everybody. I think I'm just going to wait till early morning and kick off the TAR file. guess i'll just have to be patient :-( haha
 
  


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
I want to, but how can I possibly use Linux? tothemax6 Linux - Newbie 16 12-07-2008 06:50 AM
abi file in the /boot directory -- possibly theoretical question only mpts Ubuntu 0 09-04-2007 11:31 AM
[Ruby] Tar'ing or Zip'ing with ruby script lmcilwain Programming 2 01-19-2007 07:56 PM
need help with tar'ing and bz2'ing a file surfbass Linux - General 4 06-01-2005 06:07 PM
TAR'ing multiple directories bob_man_uk Linux - Software 3 02-03-2005 12:08 PM


All times are GMT -5. The time now is 05:48 AM.

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