Page 1 of 1

Differential backups?

Posted: Thu Nov 06, 2008 7:50 pm
by alex.barylski
I asked a similar quesiton on an oother forum and only received replies telling me how I was using SVN incorrectly. So this time I'll try and make myself more clear.

I do not wish to use SVN I simply want to make backups at days end and have any changes merged with the previous backup, similar to what SVN offers but the reverse.

Ideally I would be able to extract revisions/changelogs from the backup much like it were a SVN repository.

Is there a way I can force SVN into doing this? svn import doesn't appear to merge with a diff...I believe I would have to check out a working copy and re-commit for changes to be merged.

I don't wish to use SVN for the simple purpose that my file structure changes frequently, enough that using SVN becomes a PITA, having to notify SVN each time I upload a new image or remove an old one or add a folder then maybe remove one, etc, etc, etc...

My code is very modular even at this level, so yes file changes happen frequently.

Ideally I want to keep my code on my Debian server as is and have SVN on my Windows machine which is where I store backups.

So I ask is there a differential backup tool for Windows or is there anyway I can force SVN into behaving this way?

Re: Differential backups?

Posted: Fri Nov 07, 2008 6:19 pm
by Ambush Commander
So, basically, you want SVN, but with an easy way to commit everything (I won't comment on the fact that you really should commit incrementally.)

Basically, you want to run `svn add --force *` and `svn status | grep '\!' | awk '{print $2;}' | xargs svn rm` (courtesy here) and then commit.

Re: Differential backups?

Posted: Fri Nov 07, 2008 7:19 pm
by alex.barylski

Code: Select all

svn add --force *
http://svnbook.red-bean.com/en/1.0/re01.html

I couldn't find the --force switch what does it do?

I don't think that will work, as I understand svn add will only add files/folders to the working copy...

What about existing files? Are they updated/merged with the latest copies?

Re: Differential backups?

Posted: Fri Nov 07, 2008 7:40 pm
by Ambush Commander
You should upgrade. Subversion 1.5 is the latest version. The --force flag causes Subversion to recurse into all subdirectories looking for new files.

Re: Differential backups?

Posted: Fri Nov 07, 2008 8:37 pm
by alex.barylski
Sorry I googled quickly to read up on the command and that is the doc I was returned...by bad.
subdirectories looking for new files.
I think that is where I will have problems. What about existing files which have just be updated and would typically updated via commit?

Actually ignore that...I guess that is why you said I would have to commit. :P

I still don't see this working what am I missing?

When I backup to my Windows machine...it's just a simple non-versioning source tree. svn add requires a working copy which I do not have...so I guess I would have to:

1. Take out a working copy
2. Upload it to file server
3. Make changes to source code, file structure through out
4. Bring working copy back to Windows desktop for backup
5. Call 'svn add' on my working copy which will bring all newly added files into repo
6. Delete all non-svn files (those which have been removed by me and no longer exist)
7. Commit all changed files into the repository

If this is correct then I understand you...

I deally I wanted a tool that would just let me drag and drop my latest version over top the previous version and and the mergers would happen automagically but this might do for now.

Thanks :)

Re: Differential backups?

Posted: Fri Nov 07, 2008 10:35 pm
by Ambush Commander
What is your ideal workflow?

Re: Differential backups?

Posted: Sat Nov 08, 2008 3:33 pm
by alex.barylski
1. Develop code on server all day
2. Make backup at days end
3. Merge latest backup with previous backup

Re: Differential backups?

Posted: Sat Nov 08, 2008 4:30 pm
by Ambush Commander
How does this sound?

1. Develop all day
2. Calculate diff of today to previous backup (which is what you're calling merging)
3. Upload backup

Re: Differential backups?

Posted: Sat Nov 08, 2008 4:40 pm
by alex.barylski
That would work too... :P

Re: Differential backups?

Posted: Sat Nov 08, 2008 4:44 pm
by Ambush Commander
Then that's SVN. Perhaps the hardest thing is getting setup; just svn checkout an empty repository on top of your current code, and then you can use the svn commands I mentioned above.

Re: Differential backups?

Posted: Mon Nov 10, 2008 11:58 am
by panic!
I love --force.