From owner-freebsd-questions@FreeBSD.ORG Wed Oct 22 21:43:55 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF34316A4B3 for ; Wed, 22 Oct 2003 21:43:55 -0700 (PDT) Received: from blue.gerhardt-it.com (gw.gerhardt-it.com [204.83.38.103]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1F5F43F75 for ; Wed, 22 Oct 2003 21:43:52 -0700 (PDT) (envelope-from scott@g-it.ca) Received: from g-it.ca (h24-78-101-202.ss.shawcable.net [24.78.101.202]) by blue.gerhardt-it.com (Postfix) with ESMTP id 45078FDAD for ; Wed, 22 Oct 2003 22:43:51 -0600 (CST) Date: Wed, 22 Oct 2003 22:43:50 -0600 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed From: Scott Gerhardt To: FreeBSD Content-Transfer-Encoding: 7bit Message-Id: <7F19C442-0513-11D8-8F40-000393801C60@g-it.ca> X-Mailer: Apple Mail (2.552) Subject: Fwd: Help: tar & find X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Oct 2003 04:43:55 -0000 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