Hi all,
I am supposed to collect a huge amount of log files from a unix system (HP-UX) onto a local system. The log files are not in one place, but they are scattered all over the Unix server. The unix server has only limited space, so that I can not create a tar file first and then compress it. I am trying to do something like tar -cvf | gzip -c but it fails due to spaces in the file name.
The command I am trying is:
find /BaseDirectory -name "*.log" | xargs tar -cvf | gzip -c > AllLogFiles.tgz
I am getting errors like:
tar: cannot stat ./BACKUP/24-11-2007. Not dumped.
tar: cannot stat 02.52.45-BACKUP.log. Not dumped.
tar: cannot stat ./BACKUP/24-11-2007. Not dumped.
tar: cannot stat 02.56.40-BACKUP.log. Not dumped.
tar: cannot stat ./BACKUP/24-11-2007. Not dumped.
Is it because of spaces or hyphens in the file name? Or am I trying a wrong command? (Original filenames are like "24-11-2007 02.53.32-BACKU.log")
Alternatively, Is there any way that I can collect all *.log files into one compressed file (so that the command doesn't error out due to lack of space while collecting log files)? The actual archive type is not important, it could be gzip, compress, pack or anything.
Thanks for reading my query, and have a nice day/evening.