Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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.
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.
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).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.