I'm trying to use rsync to backup a directory from one machine to another, via SSH and a key. But it copies my private key over too - when I don't want it to.
I've tried '--exclude=keyname' but that just stops it from working altogether.
Here's my code:
Code:
rsync -ave "ssh -i /path/to/sshkey" /path/to/original/files/on/my/machine dest@ip.add.ress:/path/to/backup/directory/on/destination/machine/
Any ideas on how to get it not to copy my private ssh key over?
Also, is this the correct code to get it to keep these two folders in sync? (basically a mirror of the folder on machine1 to the folder on the destination machine2).
Thanks in advance!