Click to See Complete Forum and Search --> : Command to Bulk Archive / Compress
undoIT
09-20-2009, 04:03 PM
I'm looking for a command that will compress every folder within a directory separately with the name of each archive reflecting the original folder name. I know that
tar czvf example.tar.gz example/
will compress an entire folder. However, I have not found a command to bulk archive. Is there such a command?
saikee
09-21-2009, 03:18 AM
You can use tar, or any copy and compress commands, to compress a subdirectory, a directory or the entire partition.
Thus it is really up to you how to define the area you wish to archive.
folkert
09-21-2009, 11:27 AM
somewhere on this forum you will find this tread:
http://www.justlinux.com/forum/showthread.php?t=142840&highlight=zip+directories
Ik think it will help you
undoIT
09-21-2009, 05:34 PM
I ended up with this command which will do the bulk archiving and compress using bzip2 for maximum compression :)
find -mindepth 1 -maxdepth 1 -type d -exec tar cjf {}.tar.bz2 {} \;