Welcome Guest | Login

How are you automating making backups of your production db?

I'm considering hacking together some kind of script triggered by cron, but first i wanted to ask what others are doing. How are you backing up your production db? anything to watch out for? (code examples would be superb too if you have the time!)

2007-06-15 07:51 AM

There is a wiki thread on this
http://www.hostingrails.com/forums/wiki_thread/22

Its a good script to FTP your database somewhere else, too. (optional) --

2007-06-15 07:56 AM

ah thanks

Will this task keep on adding new backup files everyday and keep all of them?

If so i was wondering if it might be best to keep only the latest x backups and delete the others (for disk space reasons).

2007-06-15 09:50 AM

Hello,

After the line "cd /home/username/backup" you can add the follwoing line to delete all your backups older that 3 days.

find . -mtime +3  -exec rm {} \;
This deletes all the files older than 3 days under the directory backup

2007-06-15 10:13 AM

HostingRails Support
Perfect, thankyou!

2007-06-15 10:32 AM

thanks you very much, such a useful script

2007-06-21 05:55 PM

>This deletes all the files older than 3 days under the directory backup
What about FTP? How can I delete old backups there?

2007-09-03 01:54 AM

Ruby.on-page.net – the simplest Ruby manual
Hello,

You wont able to execute this command via FTP. You need to have a cron job set on the FTP server to delete the files that are older than 3 days.

2007-09-03 05:36 AM

HostingRails Support
If you have an irrational fear of shell scripts like I do you can use Rake + Amazon S3:
http://www.rubyinside.com/advent2006/15-s3rake.html (updated code here: http://www.railsenvy.com/assets/2007/6/19/s3_rake_tasks.zip)

I found both of these at the RailsEnvy Rake tutorial: http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial#useful_resources

2007-09-07 07:05 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!