Hi all. This looks like a common question. I want to backup a dir, in
which i put some symlinks, so it looks like
machinegun:/tmp/daily_backup # ls -la
total 8
drwxr-xr-x 2 root root 4096 2010-02-17 17:41 .
drwxrwxrwt 19 root root 4096 2010-02-17 17:30 ..
lrwxrwxrwx 1 root root 16 2010-02-17 17:41 cgi-bin -> /srv/www/cgi-bin
lrwxrwxrwx 1 root root 4 2010-02-17 17:17 etc -> /etc
This is the rsyncd.conf
[backup]
path = /tmp/daily_backup
comment = Dir for backupear
auth users = backup
hosts allow = 10.10.8.105
secrets file = /etc/rsyncd.secrets
read only = true
So, when i try to rsync from 10.10.8.105:
gherzig at 10.10.8.105:/tmp/bkp> rsync -avz --copy-links
backup at machinegun::backup .
receiving file list ... symlink has no referent: "/cgi-bin" (in
backup)
rsync: readlink_stat("/etc" (in backup)) failed: Too many levels of
symbolic links (40)
done
./
sent 71 bytes received 269 bytes 680.00 bytes/sec
total size is 0 speedup is 0.00
rsync error: some files could not be transferred (code 23) at
main.c(1397) [generator=2.6.9]
So, looks like 2 diff errors, but no one make sense to me.
The only way it works is by not using the --copy-links, but i just want
to treat those symlinks as directories!
Can anyone give me a hint?
Thanks!
Gerardo
On Wed, Feb 17, 2010, Gerardo Herzig wrote:>Hi all. This looks like a common question. I want to backup a dir, in >which i put some symlinks, so it looks like > >machinegun:/tmp/daily_backup # ls -la >total 8 >drwxr-xr-x 2 root root 4096 2010-02-17 17:41 . >drwxrwxrwt 19 root root 4096 2010-02-17 17:30 .. >lrwxrwxrwx 1 root root 16 2010-02-17 17:41 cgi-bin -> /srv/www/cgi-bin >lrwxrwxrwx 1 root root 4 2010-02-17 17:17 etc -> /etc > >This is the rsyncd.conf >[backup] >path = /tmp/daily_backup >comment = Dir for backupear >auth users = backup >hosts allow = 10.10.8.105 >secrets file = /etc/rsyncd.secrets >read only = true > > >So, when i try to rsync from 10.10.8.105: >gherzig at 10.10.8.105:/tmp/bkp> rsync -avz --copy-links >backup at machinegun::backup . >receiving file list ... symlink has no referent: "/cgi-bin" (in backup) >rsync: readlink_stat("/etc" (in backup)) failed: Too many levels of >symbolic links (40)Set ``use chroot = yes'' in your module definition above. This keeps symlinks intact, and doesn't have any interaction with the host system. I normally use the options ``--delete-excluded -aHrxF'' which preserves hard links, and uses .rsync-filter files to exclude things like pid files and other cruft that shouldn't be copied. Bill -- INTERNET: bill at celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax: (206) 232-9186 Skype: jwccsllc (206) 855-5792 The law becomes the weapon of every kind of greed. Instead of checking crime, the law itself is guilty of the evils it is supposed to punish. -- Frederic Bastiat, The Law
On Wed, 2010-02-17 at 16:37 -0300, Gerardo Herzig wrote:> Hi all. This looks like a common question. I want to backup a dir, in > which i put some symlinks, so it looks like > > machinegun:/tmp/daily_backup # ls -la > total 8 > drwxr-xr-x 2 root root 4096 2010-02-17 17:41 . > drwxrwxrwt 19 root root 4096 2010-02-17 17:30 .. > lrwxrwxrwx 1 root root 16 2010-02-17 17:41 cgi-bin -> /srv/www/cgi-bin > lrwxrwxrwx 1 root root 4 2010-02-17 17:17 etc -> /etc > > This is the rsyncd.conf > [backup] > path = /tmp/daily_backup > comment = Dir for backupear > auth users = backup > hosts allow = 10.10.8.105 > secrets file = /etc/rsyncd.secrets > read only = true > > > So, when i try to rsync from 10.10.8.105: > gherzig at 10.10.8.105:/tmp/bkp> rsync -avz --copy-links > backup at machinegun::backup . > receiving file list ... symlink has no referent: "/cgi-bin" (in backup) > rsync: readlink_stat("/etc" (in backup)) failed: Too many levels of > symbolic links (40) > done > ./ > > sent 71 bytes received 269 bytes 680.00 bytes/sec > total size is 0 speedup is 0.00 > rsync error: some files could not be transferred (code 23) at > main.c(1397) [generator=2.6.9] > > > So, looks like 2 diff errors, but no one make sense to me.By default, the daemon chroots into the root directory of the module, which is causing the symlinks to be interpreted differently than you intend. Try setting "use chroot = no". -- Matt