Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automating rsync Backups to Dreamhost
#1
Hello,

Dreamhost (my web hosting provider) provides 50 GB of space for backups of any data I choose. I have successfully created an rsync (a unix program for doing backups) script that backups my iPhoto files (all 32 GB of them!). The script works fine when I run it from the terminal, but when I created a cron job (cron is another unix utility for automating different tasks--such as the running of a backup script) to run the rsync job, it fails.

The cronjob *does* try to run the rsync script, but I get an error that seems to indicate there is an authorization issue.

I had to do some stuff with setting up a public key for the sftp part of the backup, and as I said, it works fine when I invoke the rsync script in Terminal, but it's not working when invoked by cron. I'm thinking this may have to do with the cron job being executed as some other user, thus making the public key invalid.

Anyone have any thoughts on this? What to check to try fixing it?

I tried creating a cron job for the root user, and telling it to execute the rsync script as me, but that didn't work, either. Same error.
Reply
#2
You will need to add the public key of the user who is running the cron job to the DH server's ~.ssh/authorized_keys2 file.
Reply
#3
I added it to an "authorized_keys" file in .ssh on the Dreamhost backup server, but note that it didn't have the "2". I saw a post somewhere while Googling that mentioned that, but I hadn't tried it.

I'll try it in a little bit (eating a hoagie right now), and report back.

Thanks!
Reply
#4
what about an Automator script to use FTP? (that's what I used)

saved it as an iCal plugin to fire off at 11pm nightly.
Reply
#5
There are reliable, affordable apps that already do rsync backups, even over a network, or over the internet. I'm curious, what prompted you to dismiss the available products and instead personally write a no-GUI custom app? For those of who don't write code, this seems like hard work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)