Rsync does not remove

I have an rsync setup to mirror a directory from the source server (a) to mirror (b). I got it to send new files that are in the source, but when I delete the file from the source, it does not delete it.

Below I use the rsync command:

rsync -vhzrplt --stats --delete --rsh='/usr/bin/ssh -q'  --exclude="core/" --exclude="cache/" /home/(a)/public_html (b):/home/(b)/public_html/

When I run rsync, I get the following result:

stdin: is not a tty
sending incremental file list
public_html/
deleting public_html/test.html

Number of files: 389
Number of files transferred: 0
Total file size: 3.16M bytes
Total transferred file size: 0 bytes
Literal data: 0 bytes
Matched data: 0 bytes
File list size: 9.25K
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 9.33K
Total bytes received: 47

sent 9.33K bytes  received 47 bytes  1.25K bytes/sec
total size is 3.16M  speedup is 336.81

As you can see, this shows that it removes test.html, but it never ends. Any help is appreciated.

+5
source share
2 answers

I was able to fix this using instead:

rsync -vhzrplt --stats --delete --rsh='/usr/bin/ssh -q'  --exclude="core/" --exclude="cache/" /home/(a)/public_html/ (b):/home/(b)/public_html/
+1
source

rsync has many options - see man rsync

eg:.

        --del                   an alias for --delete-during
        --delete                delete extraneous files from dest dirs
        --delete-before         receiver deletes before transfer (default)
        --delete-during         receiver deletes during xfer, not before
        --delete-delay          find deletions during, delete after
        --delete-after          receiver deletes after transfer, not before
        --delete-excluded       also delete excluded files from dest dirs

, .

+1

All Articles