Re: tar-ing subdirectories separately

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



Hello Johan,

On Sun, 2011-01-23 at 14:51 -0600, Johan Martinez wrote:
> I want to backup a directory using tar, but want separate tarballs for
> each subdirectory. For example:  # ls dir1
> subdir1 subdir2 subdir3

Use find(1) for such cases.

$ find <dir> -mindepth 1 -maxdepth 1 -type d -exec tar cz {} -f {}.tgz \;

Regards,
Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research


_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux