Fwd: Help: tar & find
Scott Gerhardt
scott at g-it.ca
Wed Oct 22 21:43:55 PDT 2003
I am having trouble combining the tar and find command. I want to tar
and
delete all .bak,.Bak,.BAK files.
I am using the following command but keep receiving errors. The tar
command
appears to be receiving a truncated file/path (some of the time, but not
always), and trying to procecss the file as two files.
Any help on this would be great.
The script is as follows
=========================================
#! /bin/bash
set +x
TAR_DIR=/home/tarbackups;
FILES_DIR=/home/common;
tar --remove-files -cvzpf $TAR_DIR/bak_files_`date +%F`.tar.gz\
`find $FILES_DIR -xdev -type f -iname "*.bak"`;
==========================================
The -xdev is to not desend into an external smb-mounted drive to a
subdirectory.
I have also tried substituting single quotes for the double quotes
around the
*.bak
Here is some error output returned:
tar: jobs/ROOF: Cannot stat: No such file or directory
tar: LAYOUTS/RESIDENTIAL/FRASER/219: Cannot stat: No such file or
directory
tar: LEWIS: Cannot stat: No such file or directory
tar: CRES.bak: Cannot stat: No such file or directory
tar: /home/technical/nfsapc30-my_documents/1999: Cannot stat: No such
file or
directory
tar: jobs/ROOF: Cannot stat: No such file or directory
tar: LAYOUTS/RESIDENTIAL/FRASER/THODE: Cannot stat: No such file or
directory
tar: RES.bak: Cannot stat: No such file or directory
Thanks,
--
Scott A. Gerhardt, P.Geo.
Gerhardt Information Technologies
More information about the freebsd-questions
mailing list