From owner-freebsd-questions@FreeBSD.ORG Sun Mar 19 22:44:13 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 41F5616A422 for ; Sun, 19 Mar 2006 22:44:13 +0000 (UTC) (envelope-from parv@pair.com) Received: from mta11.adelphia.net (mta11.adelphia.net [68.168.78.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8C26C43D46 for ; Sun, 19 Mar 2006 22:44:12 +0000 (GMT) (envelope-from parv@pair.com) Received: from default.chvlva.adelphia.net ([69.160.66.115]) by mta11.adelphia.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060319224411.QZSP28141.mta11.adelphia.net@default.chvlva.adelphia.net>; Sun, 19 Mar 2006 17:44:11 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id C2C08B661; Sun, 19 Mar 2006 17:44:18 -0500 (EST) Date: Sun, 19 Mar 2006 17:44:18 -0500 From: Parv To: Pat Maddox Message-ID: <20060319224418.GC4787@holestein.holy.cow> Mail-Followup-To: Pat Maddox , FreeBSD Questions References: <810a540e0603191355n3e86fe15pa15a24da1a48dce8@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <810a540e0603191355n3e86fe15pa15a24da1a48dce8@mail.gmail.com> Cc: FreeBSD Questions Subject: Re: rsync script not excluding dirs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Mar 2006 22:44:13 -0000 in message <810a540e0603191355n3e86fe15pa15a24da1a48dce8@mail.gmail.com>, wrote Pat Maddox thusly... > > I have a backup script that runs nightly, and I want it to exclude > certain dirs (ports, obj, etc). However when I run the script it > doesn't exclude anything, leaving me with pretty massive backups. ... > /, /var, /usr, and /backup are all on different partitions. The key > part is at the bottom where it calls rsync and excludes dirs. Can > someone tell me what's wrong with the script? ... > PRE="/usr/local/bin/rsync" > ${PRE} -bapoguLxSRC --exclude=*.core --exclude=*~* / --exclude=/dev > --exclude=/backup /backup/${DAY1}/ > ${PRE} -bapoguLxSRC --exclude=*.core --exclude=*~* /var /backup/${DAY1}/ > ${PRE} -bapoguLxSRC --exclude=*.core --exclude=*~* --exclude=/usr/src > --exclude=/usr/ports --exclude=/usr/obj /usr /backup/${DAY1}/ Your script seems to have wrapped by your mail client. Anyway, in rsync(1) man page, see "INCLUDE/EXCLUDE PATTERN RULES" section, point 2 ... o if the pattern ends with a / then it will only match a direc- tory, not a file, link, or device. In other words, none of your exclude patterns for directories end in '/' , thus the backup, src, ports, etc. directories are not excluded. - Parv --