A Windows filesystem is mounted through samba and I am trying to compress a large amount of small files:
find /path/to/files/ -newermt "2012-01-01 00:00:00" -path '*/*log.txt' -exec tar cvfz log_file_system.tar.gz {} +
but after a while the size of the tarball is reseted.
/path/to/files/log1.txt
tar: Removing leading `/' from member names <- the size of the tar became zero
/path/to/files/log2.txt
Why is this happening? How can I fix that?
The -exec "+" option will only build a command line that's up to a limited length. Once the total command line length exceeds this size, it will start a new command line. This problem is similar to xargs.
You'll want to pipe the file name input to tar, using -T-.