Using a find | tar
pipe is something from the stoneage of UNIX when the only way to reuse code was to combine commands via pipelines.
This is slow because it requires to run stat(2)
twice for every file.
Since 33 years, there is another way to combine reusable code by using shared libraries and since 16 years, there is libfind
that includes all features of the find command in a way that allows to reuse the functionality.
Since you are using non-standard tar
options like -T
, it seems that you are using gtar
instead of tar
and gtar is known for it's ineffective code for creating the tar headers.
I recommend you to have a look at star
, the oldest free tar
implementation that includes libfind
support since 2005 and includes support for a -find
option that permits to use find(1)
syntax to the right side of -find
on the command line.
Check e.g. the man page from the schilytools web page at: http://schilytools.sourceforge.net/man/man1/star.1.html
This leads to a command line similar to:
star -c -f /tmp/xxx.tar -find . -type f -mtime +7