Re: OT: about compressed tarball

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Stephen Liu wrote:
> The new compressed tarball created consisted of the old and new
> directories, without removing the old directory.

That's why I was saying you'd need to do some programming. (I probably
should have left in the bit I wrote saying that if you append to a tar
file, it doesn't affect what's already there.)

> I think tar and bzip2 are not the tools for my application.  Any other
> suggestions? 

What exactly are you trying to do? Is this a "general purpose" user
directory, or are these files being created by scripts or something?

One option is zip -ru. It's compatible with pkzip/WinZip/ZipCentral on
DOS/Windows. It will update modified files, add new files, and leave old
ones alone, which sounds like it's close to what you want. It can also
store at least some Unix things like symlinks and user/group IDs (use
the -y option for symlinks). See man zip for more details.

Note that if you delete a file from the source directory, it will still
be in the zipfile. You might be able to script something like
for i in "$(zipinfo -1 zipfile.zip)"; do [ -e "$i" ] || zip -d zipfile.zip "$i" ; done
to list all the files in the zipfile, check that they still exist (in
the source directory), and if not delete them (from the zipfile).

Alternatively, you might be able to use rsync to do a backup across the
network (and possibly to a faster machine, or one which you can leave
for however long it takes to do the bzip2).

Or you could just recreate the .tar.bz2 (or .tar.gz) each time.

Hope this helps,

James.
-- 
E-mail address: james | "We completely deny the allegations, and we're
@westexe.demon.co.uk  | trying to identify the alligators."


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux