rsync with specific account and password Specify a specific account and password to do rsync

Phanix
·
·
IPFS
·

Actions similar to password input are mainly done through the sshpass suite.

 $ sudo crontab -l
* * * * * rsync -ratlz --delete-after --rsh="/usr/bin/sshpass -p YOURPASSWORD ssh -o StrictHostKeyChecking=no -l YOURACCOUNT" /LOCAL/PATH/TO/SYNC/ REMOTE_ADDR:/REMOTE /PATH/TO/SYNC/

In addition, adding --delete-after means that the files deleted from the source end should also be in remote sync, and the delete action is performed after syncing the new files.

Original link: Phanix's Blog

CC BY-NC-ND 2.0

Like my work? Don't forget to support and clap, let me know that you are with me on the road of creation. Keep this enthusiasm together!