Is it possible to do the following:
1. Hot database backup of mysql database from Rails 3 application
2. Incremental database backup of mysql database from Rails 3 application
3. Cold database backup of mysql database from Rails 3 application
4. Restore any of the above databases ( Hot, incremental and cold) through Rails 3 application.
Please let me know how to achieve this?
Thanks,
Sudhir C.N.
Setup some cronjobs. I like to use Whenever for writing them. I run this bash script once per day:
And output it to
cron.log. This may require some tweaking on your end, but it works great once you get it. E-mails the backup to you once per day as a gzipped file, my database is fairly large and file is under 2000kb right now.It’s not the safest technique, so if you’re really concerned that someone might get into your e-mail and get access to the backups (which should have sensitive information encrypted anyways), then you’ll have to find another solution.
To restore:
or something similar… I don’t need to restore often so I don’t know this one off the top of my head, but a quick google search should turn up something if this doesn’t work.