[lug] excluding directories with rsync
Zan Lynx
zlynx at acm.org
Wed Oct 11 16:14:36 MDT 2006
On Wed, 2006-10-11 at 15:43 -0600, Paul Nowosielski wrote:
> Dear All,
>
> I'm trying to setup an rsync script to push data from a dev box to a live box.
>
> The files live in different directories under /var/www
>
> I need to exclude 5 of the directories and their content from being
> propagated.
>
> I've found a command to exclude files but not directories.
>
> Does anyone know of a command or switch to do this?
>
> Thank you,
>
--exclude works fine for both files and directories.
For example, here is the command from a backup script I used to use:
ssh oberon rsync -az \
--password-file=/root/rsync-password \
--verbose \
--verbose \
--numeric-ids \
--delete --delete-excluded \
--exclude=/proc \
--exclude=/sys \
--exclude=/tmp \
--exclude=/var/tmp \
--exclude=/usr/tmp \
/ snapshot at green::snapshots/${newdir#/home/snapshots} \
> /tmp/oberon.log 2>/tmp/oberon.errors </dev/null
--
Zan Lynx <zlynx at acm.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20061011/b1eed55c/attachment.pgp>
More information about the LUG
mailing list