I have a series of files called:
2014111test.log
2014111test.log.stuff
2014111test.log.flibble
2014115test.log
2014115test.log.stuff
2014115test.log.flibble
I want to find all the log files over a certain age, then tar.gz them along with any other file with the same beginning part of the name into an archive.
$ find . -name '20*.log' -ctime +90 -exec 'tar zvcf /var/log/logzip/{}.tgz {}*' \;
find: tar zvcf /var/log/fwlogzip/./2014111test.log.tgz ./2014111test.log*: No such file or directory
...
However, if I type
tar zvcf /var/log/fwlogzip/./2014111test.log.tgz ./2014111test.log*
by itself, it works fine. So it looks like something is going wrong with the globbing as find passes the command to the shell.
What am I missing?