3

I have a folder on a local machine and want to rsync to a folder on a remote machine. I would like to evaluate the copy against a folder on the remote machine --link-dest. The target directory will then be hardlinked to the link--destination folder.

I keep getting no such file or directory errors:

rysnc -avh -e `ssh -p 2346` --link-dest=user@remote:home/user/techapps/backup user@remote:/home/user/techapps/target

Is this possible to do ? or am I just writing it wrong?

6

When specifying the --link-dest option for a destination that is on a remote host, your path should be given as a relative path from the perspective of the destination path. Don't use the user@host:full path syntax.

Of course since the goal is for hard links, it is obviously required for the destination path, and the link-dest path to both exist on the same filesystem.

--link-dest=DIR

...

If DIR is a relative path, it is relative to the destination directory.

  • Hey thanks for the response - still having problems should I put the link-dest as ../backup ? The destination and link-destination are in the same folder on the remote machine - the source is on local - tried lots of combinations but keeps saying linkdest no such file or directory (2) – howard Sep 11 '14 at 15:46
  • What do you mean the link-dest and destination are the same folder? That doesn't make any sense? – Zoredache Sep 11 '14 at 16:27
  • Think I got it - those back ticks were messing it up - it works now but the hardlinks dont seem to be there ie the files in the linkdest folder dont state that there is 2 only 1 same in the destination – howard Sep 11 '14 at 17:04
  • Got it ! Two days :) Never did the initial backup - hardlinks working. – howard Sep 11 '14 at 17:46
  • You should post what you had to do to solve your problem if it fixing it wasn't related to my answer. – Zoredache Sep 11 '14 at 17:47
1

Ok the relative path part worked ie --link-dest=../full and the rest was double quotes on the "ssh -p 2346" not back ticks. The hardlinks weren't present because I was concentrating too hard on getting --link-dest working that I never did an initial back from source to link dest folder. Sorry never used this site before but thanks again the relative path suggestion sorted it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.