Rsynch and SSH: only rename folder when renaming from source

I read the rsync documentation for several hours, but I cannot figure out how to transfer rsync as soon as I rename (rather than reload the folder and its contents) the destination folder when they are renamed to the source.

I connect to the recipient with SSH, and the local folder is the source, and the remote server is the destination. If I rename the folder containing the files, rsync will automatically reload the entire contents of the original folder. I do not use part of the rsync server, maybe it would work if it were done?

I came across the same behavior with lftp, and this tool does not seem to have these parameters. Even if it is based on a file date rule, files inside the renamed folder are deleted / reloaded.

Thanks in advance if anyone knows how to do this :)

+3
source share
2 answers

How does rsync or any other program know what is renamed? What if the two directories are very similar candidates and somehow rsync guesses, maybe you could rename what was before? It's impossible. I think you are stuck with downloading everything again.

You know about the --delete option, on the right:

- delete files that do not exist on the sending side

Note that the -force option:

- forced removal of directories, even if it is not empty

+1
source

I was looking for something like that.

The best solution I found is at:

http://serenadetoacuckooo.blogspot.com/2009/07/rsync-and-directory-renaming.html

, , .
, rsync, ( .)

, rsync, , .

+2

Source: https://habr.com/ru/post/1728665/


All Articles