{{tag>rsync troubleshooting}} ====== rsync troubleshooting ====== ===== SSH agent and rsync ===== Using rsync in crontab of different user than root requires adding additional ENV variables. Example: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin SSH_AUTH_SOCK=/run/user/1000/keyring/ssh 53 14 * * * rsync -aq root@example.com:/root/backups/ /home/user/Documents/backups/ 30 14 * * 1 rsync -aq root@example.org:/root/backup/* /home/user/Documents/backup/ ===== Trouble with screen program ===== Add this to //.bashrc// file if there are issues when running rsync in [[https://linux.die.net/man/1/screen|screen]]: if [[ -z "${SSH_CONNECTION}" ]]; then export $(gnome-keyring-daemon --start ) fi if [ -S "$SSH_AUTH_SOCK" ] && [ ! -h "$SSH_AUTH_SOCK" ]; then ln -sf "$SSH_AUTH_SOCK" ~/.ssh/ssh_auth_sock fi export SSH_AUTH_SOCK=~/.ssh/ssh_auth_sock ====== Tested on ====== * ====== See also ====== ====== References ====== * http://serverfault.com/questions/92683/execute-rsync-command-over-ssh-with-an-ssh-agent-via-crontab