You are not logged in.

#1 2019-11-24 13:56:17

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,473

Is it possible to prevent rsync from walking into an excluded dir?

I'm trying to make a backup via rsync, but i'm facing the following:

sudo rsync --recursive -a --delete --delete-excluded --progress --one-file-system / \
--exclude '*/mnt/autofs*' \
$DEST/

From what i understood, and as stated in the rsync man page:

--exclude=PATTERN       exclude files matching PATT

Still, when i start it:

[..]
file has vanished: "/mnt/autofs/gozer/bin/bcpasswd"
file has vanished: "/mnt/autofs/gozer/bin/python2.5"
file has vanished: "/mnt/autofs/gozer/bin/bcinfo"
file has vanished: "/mnt/autofs/gozer/bin/bcnew"
file has vanished: "/mnt/autofs/gozer/bin/bcmount"
file has vanished: "/mnt/autofs/gozer/bin/bcreencrypt"
file has vanished: "/mnt/autofs/gozer/bin/vmware-uninstall"
file has vanished: "/mnt/autofs/gozer/bin/bcunlink"
file has vanished: "/mnt/autofs/gozer/bin/xt7-player"
file has vanished: "/mnt/autofs/gozer/bin/bcfsck"
file has vanished: "/mnt/autofs/gozer/bin/bcumount"
file has vanished: "/mnt/autofs/gozer/bin/kde-config"
file has vanished: "/mnt/autofs/gozer/bin/bclink"
file has vanished: "/mnt/autofs/gozer/bin/bcmake_hidden"
file has vanished: "/mnt/autofs/gozer/bin/bcformat"
[..]

...So rsync enters the autofs tree causing everything to be mounted, and then skips everything; but slowing everything down.
How can i tell it: "Hey, that dir is excluded, don't walk into it" ?

Thanks.

-EDIT-
By now i'm stopping autofs before the backup and enabling it afterwards.

Last edited by kokoko3k (2019-11-24 14:05:30)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2019-11-24 15:11:03

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,517
Website

Re: Is it possible to prevent rsync from walking into an excluded dir?

Your pattern is wrong.  '*/mnt/autofs/*' does not match anything under /mnt/autofs.  Remove the leading asterisk.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2019-11-24 16:32:41

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,473

Re: Is it possible to prevent rsync from walking into an excluded dir?

Thanks, did it.
However for some reason now it honours --one-file-system directive (autofs mounts his own filesystem under /mnt/autofs), so i cannot test if removing the wildcard suffices.
Now that i think of it, shouldn't it be: "mnt/autofs*" instead of "/mnt/autofs*" ?


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2019-11-24 18:34:58

qinohe
Member
From: Netherlands
Registered: 2012-06-20
Posts: 1,599

Re: Is it possible to prevent rsync from walking into an excluded dir?

kokoko3k wrote:

Now that i think of it, shouldn't it be: "mnt/autofs*" instead of "/mnt/autofs*" ?

Not if it is part of the command itself, but if you put in an exclude file then yes.

Offline

Board footer

Powered by FluxBB