Posts Tagged ‘ssh’

The Curious Case of Bandar and The Shell Scripts

Tuesday, July 6th, 2010

My short time on a Dreamhost Private Server is over. I have moved all my domains back over to shared hosting, which is the lovely server named bandar. During the move I took some time to examine the files for my iphone applications and my website. I noticed that Dreamhost must have recovered files for me when the server originally crashed. The data being sent to over 2,000 iphones was about a month old but still up to date have no fear! I have updated them tonight and will check tomorrow to make sure my nightly cron jobs to update the scripts is working.

I was very happy with the private server from Dreamhost although for me it would have been a waste to keep the server for more than the free trial period. An average site like mine would cost about $15/per month for 300MB of Ram(which is more than enough!). If anyone is looking for hosting and a private server I would recommend Dreamhost.

I was thinking about backup recently due to the downtime of my websites. I decided I might every week or so depending on the amount of data changed download a copy of my websites to keep as a backup. Nothing to fancy, just a shell script. Below are the two scripts I run, first on the server and then on my computer. I might make the server side script a cron job in the future.

Backup script on the server:

#!/bin/sh
tar -zcvf website1.tar.gz website1.com/
tar -zcvf website2.tar.gz website2.com/
tar -zcvf website3.tar.gz website3.com/

Shell script to download the files to my computer:

#!/bin/sh
sftp username@thermomods.com << EOF
get website1.tar.gz
get website2.tar.gz
get website3.tar.gz
exit
EOF
echo "End of Line."
exit