How to force rsync to use destination directory as root
- by thepurplepixel
I have a simple script to one-way-sync files/folders within a directory:
#!/bin/bash
HOST='<hostname>'
USER='<username>'
DIR='/downloads/'
SOURCE='/srv/torrents'
rsync -e "ssh -l $USER" --remove-source-files -h -4 -r --stats --progress -i $SOURCE $HOST:$DIR
find $SOURCE -type d -empty -prune -exec rmdir -p \{\} \;
However, when this rsync operation runs, it creates a folder, torrents in /downloads on the destination machine. How can I force rsync to put all folders & files from /srv/torrents (remote) into /downloads/ (local) instead of creating /downloads/torrents as a separate directory?