LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 01:43 PM   #1
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Rep: Reputation: 49
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 anon091; 09-04-2009 at 01:43 PM. Reason: proper grammer
 
Old 09-04-2009, 01:48 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
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, 01:49 PM   #3
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

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

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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, 02:01 PM   #5
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
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, 03:23 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
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, 03:25 PM   #7
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
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, 04:07 PM   #8
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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, 04:10 PM   #9
anon091
Senior Member
 
Registered: Jun 2009
Posts: 1,795

Original Poster
Rep: Reputation: 49
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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:37 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
Open Source Consulting | Domain Registration