Automated rsync to backup user?



Recently switched to Dreamhost shared from a VPS to get some piece of mind :slight_smile:

The stuff i host is nothing too important so besides occasional local backups of files and databases, just syncing stuff over to the Dreamhost Backup user seems like good enough, cheap protection for accidential deletes and other hiccups.

Now on to my question, is there any way to run rsync in a cronjob between the main user account and backup?

The problem with my little rsync script is that i can’t get around the password prompt for the backup user when running it, rendering it unable to run as a cron job.

Since there is no SSH access to the backup account, i can’t manage to set up keys between them. And the -password-file option seems to not work in this case.

Thanks in advance!


You can’t SSH into the backups server, but it does support SFTP, which means it supports SSH file transfers. You can use your typical SSH tricks here, such as a private/public key combo. I use SSH keys to SFTP to my backups account.

I recommend that you create a new SSH key for just this purpose, since you will need to leave your private SSH key on your web server account.