Hi All, I'm new to the forum and desperately trying to work out what's going on here!
I'm trying to do something fairly simple..... find files which have been modified in the past 24hrs with the exception of TAR files.... and then tar them all up nicely.
The command: find .. -mtime -1 -a ! -iname "*.tar"
seems to nicely output the correctly filtered files to STD_OUT.
I've then tried exec and xargs to tar them, but i then get a tar file will all files, not the filtered ones.
I've tried;
find .. -mtime -1 -a ! -iname "*.tar" -exec tar cvf output.tar '{}' \;
and
find .. -mtime -1 -a ! -iname "*.tar" | xargs tar cvf output.tar
both tars include files not modified within 24 hours and contain other tar files. When it gets to itself, the file grows out of control.
Can anyone please help me understand why the first command shows the results filtered, get after the redirection they're expanded back out!??? I'm going mad here.... any help would be much appreciated
TIA
I'm trying to do something fairly simple..... find files which have been modified in the past 24hrs with the exception of TAR files.... and then tar them all up nicely.
The command: find .. -mtime -1 -a ! -iname "*.tar"
seems to nicely output the correctly filtered files to STD_OUT.
I've then tried exec and xargs to tar them, but i then get a tar file will all files, not the filtered ones.
I've tried;
find .. -mtime -1 -a ! -iname "*.tar" -exec tar cvf output.tar '{}' \;
and
find .. -mtime -1 -a ! -iname "*.tar" | xargs tar cvf output.tar
both tars include files not modified within 24 hours and contain other tar files. When it gets to itself, the file grows out of control.
Can anyone please help me understand why the first command shows the results filtered, get after the redirection they're expanded back out!??? I'm going mad here.... any help would be much appreciated
TIA
Last edited: