Rsync not copying symlink
Due to some space issues we replaced the images directory wit ha symlink by the same name images. It seems that my rsync command isn't following the symlink for the images directory. I have rsync 2.6.3. How do i get it to work as it hasn't backed up any images created since the switch over to the symlink?
command: /usr/bin/rsync --compress -a -L -k --progress --stats --exclude 'logs/' \ --exclude 'cache/' --exclude 'templates_c/' --exclude 'postgres/' \ --exclude 'mysql/' --exclude 'lost+found/' --exclude 'qscand/' \ --exclude 'vpopmail/' --exclude 'spamd/' --exclude 'tmp/' --exclude 'sqlcache/' \ --exclude 'servint/' \ /home/ /storage1/backup/ I have tried -k and -K. It has a backup directory called images already, but its not continueing with the symlink content into that directory. |
Hi
From man rsync: -a, --archive archive mode; same as -rlptgoD (no -H) -l, --links copy symlinks as symlinks -L, --copy-links transform symlink into referent file/dir --copy-unsafe-links only "unsafe" symlinks are transformed --safe-links ignore symlinks that point outside the tree So you're telling rsync both -l (copy symlinks as symlinks) and -L (transform symlink into referent file/dir) Maybe change "-a" into "-rptgoD"? |
From what it sounds, -L is what I want. I want it to copy the data in the symlink to a backup directory. However its not.
|
Well did you try without the -a option? I don't have the same version, but when I specified both -l and -L, I got the -l behaviour when I tried. Passing -k gave an error message - I don't know what it means.
|
Ill try removing the -a and using -L -K
|
Well, as I said, "-a" is the same as -rlptgoD" (-r -l -p - t -g - o -D), so you'll then lose stuff like ownership and permissions.
Why not change it to "-rptgoDLK"? |
Ill try that then ;) thanks for the help so far guys
|
Quote:
|
Well i have tried this:
/usr/bin/rsync --compress -rptgoDLK --progress --stats --exclude 'logs/' \ --exclude 'cache/' --exclude 'templates_c/' --exclude 'postgres/' \ --exclude 'mysql/' --exclude 'lost+found/' --exclude 'qscand/' \ --exclude 'vpopmail/' --exclude 'spamd/' --exclude 'tmp/' --exclude 'sqlcache/' \--exclude 'servint/' \/home/ /storage1/backup/ It doesn't seem to work when i try to run it from the root directory. Its not even backing up new files regardless of the symlink. |
use --force, it'll delete non-empty directories and replace them with symlinks
make sure you don't need anything in the destination directory, first ;) |
All times are GMT -5. The time now is 12:17 AM. |