0

I have a directory with lots of large files, that is regularly backed up using rsync on to a different drive.

Now let's say I'd like to rename a directory on the master file system. What rsync seems to do is to re-upload all files from the renamed directory.

Is there a tool that is a simple to use as rsync (i.e. commandline, doesn't require daemons, etc.) that will just rename directory in the target location?

1 Answer 1

0

The -H option is intended to preserve all the hardlinks within the rsync'ed hierarchy. The solution is:

cp -al oldname newname
rsync -aH ...
rm -r oldname
rsync -aH --del ...

The other possibility is to manually rename directories on the both sides between the synchronizations.

2
  • Kondybas, the word "obvious" you used in two places doesn't come across well, it can be interpreted as a mild insult. I have made a small edit to your post.
    – Tim
    Jul 3, 2017 at 21:13
  • @Tim Thanks man! Only manual renaming is obvious while hardlink trick isn't.
    – Kondybas
    Jul 3, 2017 at 23:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .