Never Again! Backing up your rails .sqlite3 dbs

Well, with mysql, it’s pretty hard to overwrite your dbs, but with sqlite, it’s real easy. I did this, luckily I only lost about a days worth of work, but nevertheless, I have instituted a new rule for sqlite3 dbs: Hourly backups.

Here’s the script:

#!/bin/sh
D=date +%H
cp -f /var/www/app/db/production.sqlite3 /var/www/fapp/db/production.sqlite3.bak.$D

About Jason

I am a 31 year old programmer living in the south of France. I currently work actively in the fields of Ruby/PHP/Javascript and server/website administration.
This entry was posted in Computer Science, General Computing, Linux, Ruby on Rails, Ruby on Rails, Tips and Tricks, Topics, Tutorials, Uncategorized, Writings and tagged , , , , . Bookmark the permalink.