[clug] rsync -r --max-depth=2
Kim Holburn
kim.holburn at gmail.com
Fri Aug 31 07:02:21 GMT 2007
What's wrong with
rsync -a server::home/ /back/
?
On 2007/Aug/31, at 8:00 AM, Michael James wrote:
> I need to pull a mirror of the home dirs on an rsync server.
> Because it's a huge job I normally run a script
> that does an rsync for each user.
>
> When it happens locally the script starts like this:
> cd /home
> for $dir in `ls -1 */*`
> do
> test -d "/back/$dir" || mkdir /back/$dir
> rsync -a /home/${dir}/ /back/${dir}/
> done
>
> From a remote rsync server I can't do shell globbing.
> So if a new user is added , the mirror will never get to know about
> it.
>
> Is there any option on rsync that will accomplish this:
>
> rsync -ra --maxdepth=2 server::home/ /mirror/
> cd /mirror
> for $dir in `ls -1 */*`
> do
> rsync -a server::home/${dir}/ /back/${dir}/
> done
>
> <Wonders> Can "-d" be encoraged to pull an unnamed dir?
>
> TIA,
> michaelj
>
> --
> Konqueror has gotten so clever for its own boots
> that it has forgotten what a web browser is for.
> --
> linux mailing list
> linux at lists.samba.org
> https://lists.samba.org/mailman/listinfo/linux
--
Kim Holburn
IT Network & Security Consultant
Ph: +39 06 855 4294 M: +39 3494957443
mailto:kim at holburn.net aim://kimholburn
skype://kholburn - PGP Public Key on request
Democracy imposed from without is the severest form of tyranny.
-- Lloyd Biggle, Jr. Analog, Apr 1961
More information about the linux
mailing list