Search code examples
solaristarsnapshotnas

query on tar and .snapshot directories


We've content which amounts to 110GB on NAS. While running tar to copy this to use in a different location, by default the ".snapshot" directories were also getting included. The corresponding tar file size way exceeded the 100GB; had to interrupt the tar command when the size reached 140GB.

Solaris 10.

Can we exclude these directories? What are the implications?

Regards,
Van


Solution

  • I thought this would be simple, but it took a while to come up with a (messy) solution:

    cd tarsource_dir

    find ./.snapshot > exclude-files

    tar cvfX /tmp/blob.tar ./exclude-file .

    ...

    ./.snapshot excluded

    ...

    Hope this at least gives some ideas!