--remove-source-files is perfectly fine if source and destination are on different volumes, but if they are on the same, you can use the following method to really move files.
Before:
find /test
/test
/test/empty_dir
/test/src
/test/src/50GB.bin
Execute rsync:
# SECONDS=0
# rsync --delete --recursive --backup --backup-dir=/test/dst /test/empty_dir/ /test/src
# echo "rsync needed $SECONDS seconds"
rsync needed 0 seconds
After:
find /test
/test
/test/dst
/test/dst/50GB.bin
/test/empty_dir
/test/src
This works because the --backup-dir feature moves and not copies files and as we compared /src against an empty dir it "deletes" everything to /dst. But note: It's still slower than mv as rsync executes a move on every file and not only on the root dir as mv would.
If you want to delete the (now empty) /src dir, use another rsync hack:
rsync --recursive --delete --include="/src**" --exclude="*" /test/empty_dir/ "/test"
Usually I would expect, that it works with one command as follows, but it seems rsync has a bug, because it did not "delete" src/50GB.bin although it claims it did:
# rsync --itemize-changes --delete --recursive --include="/src**" --exclude="*" --backup --backup-dir=/test/dst /test/empty_dir/ /test/src
*deleting src/50GB.bin
cannot delete non-empty directory: src