![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| tarring/compressing files in Unix directory | montski | Shell Programming and Scripting | 1 | 02-15-2008 01:19 PM |
| Unzip files where modified time>05:00 ? | SunnyK | Shell Programming and Scripting | 3 | 11-06-2007 07:15 AM |
| tarring large no. of files | marwan | UNIX for Dummies Questions & Answers | 4 | 08-19-2007 12:45 PM |
| Finding modified files | rhayabusa | UNIX for Dummies Questions & Answers | 2 | 12-16-2004 10:48 AM |
| tarring and gzipping dump files | PSC | UNIX for Dummies Questions & Answers | 4 | 07-23-2004 12:50 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
backup : files being modified while tarring
I would like to back up several directories weekly using a cronjob.
I'm not experienced in UNIX, but I would start like this: tar -cvf backup.tar dir1 dir2 dir3 Now if a file is being modified in the process it will result in an error. How can I prevent this from happening and how can I determine if the backup has been succesful ? Last edited by jamesbond; 10-12-2001 at 03:16 PM. |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Hi
I don't think if a file is being modified while the filesystem backup is going on, it will give you an error, But yes it will result in an inconsistent backup of the filesystem. For this either you have to confirm that the file backup starts late at night when no one modifies the files or The most recommended option is to bring the system in the single user mode and then start the filesystem backup.
|
|
#3
|
||||
|
||||
|
kapliv is correct in saying that the best
way to do a backup is in single user mode. You can in fact get an error if a file that tar is in the process of reading gets modified by another process. You can use the... --ignore-failed-read ...option and tar should just continue with the next file. Check your man page carefully. |
|
#4
|
|||
|
|||
|
Thank you both for your information!
One more question though: Would it be possible to switch to 'single user mode' and back without rebooting? If so, how is this done? (I've searched the internet for info on this, but no luck) I'm running freebsd 4.1 |
|
#5
|
|||
|
|||
|
Hi
Quote:
|
|
#6
|
||||
|
||||
|
If you want to try to "get" the error you
must be writing the exact same file (not just the directory) as tar just opened for reading. Note that I have only experienced this problem 3 times in 2 years and it has been when developers are working late (in the middle of the night when the backups run) and makeing changes to several source files in the CVS tree. It's really hit or miss (especially with small files). |
||||
| Google The UNIX and Linux Forums |