pBacker

pBacker is (in my opinion) a handy little tool that automatically makes sure to keep your source code backed up in a time-based archive so you can always "rewind" it to any point in time. In effect, the goal is to give you unlimited undo power over everything you write.

pBacker is a command line utility, and you can run it manually, but I would strongly urge you to place it in the Windows Scheduler. When doing its backups, it has a resolution of one minute, but for most people's purposes running it once a day is about right. Plus then you can of course run it when you're not doing anything (not that it takes many resources).

The following files are in the distro:

pBacker.bas This is the full source code. Feel free to edit it to suit your needs. It compiles under PB CC 2.x but you could easily modify it to run under a more bloated compiler like VB if that's your thing.

pBacker.exe This is the program itself. Yes, it's really that small (about 25k) and does not require any additional DLLs or downloads.

pBacker.log Actually, this file isn't in the distro, but any time that pBacker runs it will write whatever it did to this log file (stored in whatever directory you decide to place the executable in). You should probably check this periodically as there are certain situations (usually overflows) that can cause the program to crash (and they will be noted here).

pBacker.ini This file (placed in the same directory as the executable) describes exactly what pBacker should be archiving and to where. You can include comments if they are preceded by a # (hash), and blank lines are fine too. pBacker ships with whatever my current settings are; edit them to suit your needs of course.

To create a backup action, insert the following line(s) into the ini file (after removing whatever junk I have in there that you don't need):

filemask in directory to directory

Or to give a specific example:

*.c,*.h in in c:\source\prog to e:\backups\prog

This will move any filenames matching *.c or *.h (please note that if you want to use comma-separated filemasks rather than just one at a time that there should be no spaces between the file masks; just a comma) in the directory c:\source\prog and, assuming that the most recent file is not already backed up, it will be placed in the following directory:

e:\backups\prog\filename.ext\YYYYMMDD-HHMMh\filename.ext

That is, it'll place it in the backup directory you specified, then in a subdirectory bearing the name of the file, and then below that another subdirectory that is named after the timestamp (of the time of backup, not a date from the file itself).

Click here to download a zip file (about 18k) of the software, sourcecode, and docs.

Anyway, I hope this is useful to someone. It's already saved me a few times, and because of it working on its own without intervention some people may find it preferable to various CVS systems and so on.

Shannon
contact info in source code