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@centos.org
http://lists.centos.org/mailman/listinfo/centos

Reply via email to