Backups are important. But usually they are made daily or even less often than this.

Quick tip I wish I had known a month ago when my MacBook froze and didn’t boot after a fruitful, productive day: backup all the code in realtime, all the time, with Dropbox.

Every CMD+S sends the file to Dropbox, and that means, that if something terrible happens to my computer (can’t boot, coffee accident, or it gets stolen), I know that all my code is backed up to the latest save.

That doesn’t even mean you should put your code directory inside the Dropbox’s one, you can Symlink it, excluding big files that don’t need to be backed up, or if you’re short on space.

A template I use for Rails projects w/ Git, excluding the tmp, log and other irrelevant folders:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
mkdir -p ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/.git ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/.gitignore ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/.rvmrc ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/app ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/Capfile ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/config ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/config.ru ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/db ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/doc ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/features ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/Gemfile ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/Gemfile.lock ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/lib ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/public ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/Rakefile ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/README ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/script ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/spec ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/test ~/Dropbox/Sites/PROJECT_NAME/
ln -s ~/Sites/PROJECT_NAME/vendor ~/Dropbox/Sites/PROJECT_NAME/

If you still don’t have a Dropbox account, you can use my referral link: Create Dropbox account or create a new account without my referral here.

Comments