Monday and Tuesday I worked on getting key based authentication ssh. I had to generate a private and public key on the source machine using ssh-keygen. You have to copy the pubkey from the source to the target and in the sshd config enable key based authentication (In Ubuntu it seems to be on by default). Once that is done you can ssh in from the account that created the key into the account that holds the pubkey.
So Wednesday Matt helped me with rsync. The two echo commands are from another script I found on the internets. As you can see the the script runs the rsync command and makes a log of what happened and appends the date to it. I included comments with what the parameters do since there are so many.
echo $’\n\n’ >> rsync.log
rsync -avzogtph /home/sysadmin/stuff/ firstname.lastname@example.org:/home/sysadmin/backup/
echo “Completed at: `/bin/date`” >> $LOGFILE
#-a archive mode
#-o preserve owner (super-user only)
#-g preserve group
#-t modification times
#-p preserve permissions
#-h human readable
I will talk to Devin about getting it set up.