Ian Turner <[EMAIL PROTECTED]> writes: >On Wednesday 10 May 2006 21:18, Sergey Poznyakoff wrote:
>> > IMNSHO it would be better if the incremental >> > restore works analogously to the non-incremental restore: That is, to not >> > delete stuff not mentioned in the archive. >> >> Than it would not be incremental restore. It's main purpose is to >> restore the filesystem in exactly the same state it had when dumped. Yes. Sergey is right: If you don't want to restore the filesystem in exactly the same state it had when dumped, then simply don't use the "--listed-incremental" parameter when extracting an incremental archive. >Eh, a more common understanding of incremental extraction is like patch: >"Apply the difference between this archive and this other archive as stored >in this archive here." "... stored in this archive here." That is, files, which are stored in the incremental archive? >I don't think that says anything about what should happen to other, >unrelated files. GNU tar is the only tool I'm aware of that goes >deleting unrelated files. What are "unrelated files"? Files, which are not stored in the incremental archive? >Look at it this way: If the user really just wants to start from >scratch, it is easy to blow away an existing directory, then do all the >appropriate restores. No. It's not easy. Imagine, you want to restore the filesystem to a state which has been archived by a sequence of two backups: a full backup, "full.tar", and a following incremental backup, "incremental.tar". So, how would you do that, if tar, when extracting incremental, wouldn't delete files? First, delete all files: $ rm -rf -- filesystem Then, extract the full backup: $ tar -x -f full.tar --listed-incremental=/dev/null Now, the filesystem reflects the state it had, when the full dump was made. Now, imagine, that in the filesystem, after the full dump, but before the incremental dump had been made, the file "filesystem/new" had been created and the file "filesystem/obsolete" had been deleted, whereas the file "filesystem/unchanged" had been retained. Then, extract the incremental backup: $ tar -x -f incremental.tar --listed-incremental=/dev/null If tar didn't remove "filesystem/obsolete", what command would you start to remove "filesystem/obsolete" while retaining "filesystem/unchanged", if all information you had about the saved filesystem states would be the tape archives mentioned above? >Look at it this way: If the user really just wants to start from >scratch, it is easy to blow away an existing directory, then do all the >appropriate restores. Please, tell me the commands to execute in order to blow away all existing files that should be deleted according to the state of the filesystem recorded in the "incremental.tar" archive, while retaining all files which were dumped into the "full.tar" archive and were not dumped again into the "incremental.tar" archive because they hadn't changed. On the other hand, if you don't want tar to remove "filesystem/obsolete" when extracting "incremental.tar", all you have to do is not to supply the "--listed-incremental" parameter: $ tar -x -f incremental.tar >But if the user does *not* want this, it requires many more operations >to make the restore to some other place and then copy it into the >directory structure s/he is interested in. Could you please explain, why $ tar -x -f incremental.tar --no-overwrite-dir wouldn't do that task? -- Wenn Sie mir E-Mail schreiben, stellen | When writing me e-mail, please Sie bitte vor meine E-Mail-Adresse | precede my e-mail address with meinen Vor- und Nachnamen, etwa so: | my full name, like Helmut Waitzmann <[EMAIL PROTECTED]>, (Helmut Waitzmann) [EMAIL PROTECTED] _______________________________________________ Bug-tar mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-tar
