Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At our company we are not using a source control so we do backup manually.

My habit is like this: I backup only scripts where I removed code snippets, and those scripts where I only added code snippets I don't backup.

Is it reasonable to backup each time when you change something, or there are some conditions for file subversion? And when we backup changed files, should we only backup that file or all the project?

share|improve this question

closed as off topic by Jim G., Walter, gnat, GlenH7, Yusubov Jan 16 '13 at 22:00

Questions on Programmers Stack Exchange are expected to relate to software development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

I think the consensus you will find here is - start using source control. Now. – Oded May 15 '12 at 12:14
Tell us this - what happens if you forget to backup a new file that becomes essential, then loose the code? – Oded May 15 '12 at 12:15
source control and backup are orthogonal - you need both, of course if you have source control backup becomes very easy to implement – jk. May 15 '12 at 12:23
up vote 17 down vote accepted

When you start asking questions like "should I backup everything or only parts", then it is time to introduce source control (heck, you should introduce source control before such questions arise). Now. No excuses. Checkin whenever you have finished a small feature slice, and backup the repo daily.

share|improve this answer
I rather disagree. The time to introduce source control is not when you start asking these questions. The time to introduce source control is when you start the project (or failing that, NOW). – Kristof Provost May 15 '12 at 14:00
@KristofProvost: dont't get me wrong, I absolutely agree with you. See my edit. – Doc Brown May 15 '12 at 14:29
I'm sure there are free (or very affordable) source control options out there. The cost of losing code far outweighs the cost of the source control almost every time. – Yatrix May 15 '12 at 14:40
@Yatrix: arguably, the best source control options are free. Git, Mercurial, Bazaar, SVN, etc. – André Paramés May 15 '12 at 15:55
@AndréParamés Haven't been crazy about SVN, personally. Hear good things bout Git though. – Yatrix May 15 '12 at 16:32

As with everything that has been said here -> introduce source control.

If I had a penny for every time that I've read about (or heard from friend's about personal) projects that have either had to be scrapped or started over because they didn't have source control... you know the rest.

Seriously, you/your company might feel like you don't need source control right now, but as when (and I hope this doesn't happen) someone deletes the wrong file, or makes a mistake, or bit-rot takes a crucial file you'll know why we use source control.

If it's a problem with management (as in they don't want to fork out for it), then inform them that there are free solutions. If they don't want a free solution, do a cost analysis of how much money it would cost to start a given project (or all of them) from scratch vs how much a licence will cost them.

If it isn't a management decision, then get on to who ever makes that decision and inform them that they should be considering source control.

I even use source control in my personal projects. One of my big projects was destroyed due to bit-rot, and once was enough to convince me that I needed some form of remote source control (for the record, I use GitHub for me personal stuff and we use Team Cohesion where I work)

EDIT: I came across a related video, just now. It's about how Pixar nearly lost the entirety of Toy Story 2 when someone keyed in the wrong command -

share|improve this answer

This is like triage, let's fix the obvious things first. So first and foremost, here's 4 of the more well known version control servers, click a link and get installing.

Then, if you go for a centralized VCS, backup your repository once a day.

There's no reason not to, and every reason to do it. It really is step #1 to having a reasonable development environment.

share|improve this answer
  1. you should back up everything, experiencing data loss shouldn't cost you more than a day of lost work.
  2. Get source control and use it, there are good free solutions, and after having used it I can't imagine not having it.
share|improve this answer

Of course using source control does not immediately mean backing up, especially with DVCS such as git or mercurial. I would REALLY (!!!!) recommend you start using it. The next step would be to sync your local git/mercurial repository with a central server for effective backup. But seriously, in professional software development source control is mandatory. In addition, it takes minimal effort to learn, and it yields big returns.

share|improve this answer

Use SVN for sure. Makes life super easy.

I usually commit my work twice a day.

Very very important that you get a source control in place...

share|improve this answer

I back up everything every night onto a series of USB hard disks. The habit helps prevent accidents. I keep one of the disks (taken on a friday) in a different location.

As the others I would also strongly recommend source control.

share|improve this answer

Use modern source control.

Use a Distributed Version Control System like Mercurial or git (over using svn).

It seems intimidating but given that you can do

sudo apt-get git or sudo apt-get install git-core git-gui git-doc
cd your_dir
git init
See for more info

Why not do it now?

For backups I would store this code on github -

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.