quote:
Originally posted by Peristarkawan:
<STRONG>Eww. This kind of thing is what shell scripts and cron jobs were made for. Much more cross-platform, and would only take a couple minutes to write. Also solves the problem of needing to remember to start it, and trivializes the task of compression to the point of just running a couple of extra commands.
[ June 11, 2007: Message edited by: Peristarkawan ]</STRONG>
You forgot to include the time it would take (if I were doing it) to install linux and/or cygwin, figure out how to start cron or find out if it's already started, figure out how to make cron work, remember how to make cron run something periodically, learn to write shell scripts, attempt to write such a shell script, and then test it. So that's basically why I didn't do that.
I could also have made it in python, but I chose c++ for some reason instead. I had done a backup script in python before, but not an automatic periodic-checking one.
The only reasons it isn't easily portable* are: (a) I stopped using linux 4 years ago, (b) cygwin has annoyed me into uninstalling it several times, and (c) I mostly made it for my own use, so I didn't bother looking up the linux alternative to the functions I was using.
* By virtue of being fairly small, it probably IS easily portable, but it may well be easier to just write one from scratch for linux instead.
Functions it uses (I don't know how many of these are windows-only. Perhaps all of them.):
FileTimeToSystemTime, MessageBox (for errors), SetCurrentDirectory, Sleep, CreateFile, GetFileTime, CloseHandle, CreateDirectory, CopyFile, FindFirstFile, CopyFile, FindNextFile, FindClose, and GetLastError.
Here is the binary and source, if anyone wants it, or feel free to make your own with shell scripts and cron jobs, or python, or whatever, of course. http://shadowlord13.googlepages.com/backupDFSave_v1.0.7z
(Personally, I only use windows XP. I've used DOS 5, 6, windows 3.1, windows 95, 98, ME, 2000, XP, and from time to time RedHat linux (before they had whatever they call their consumer-ish version), Mandrake linux (before mandriva existed), and Gentoo linux (with blackbox and reiserfs for a filesystem). I liked Gentoo the best out of all the linuxes I tried**. However, I tried XP after Gentoo, and to be honest, I rather liked XP better than any linux I had tried. Plus vastly more games worked on XP than on linux. I hear that has probably improved since then, but then I've also heard that new WINE versions have broken games which used to work too, so I think I'll stick with what works reliably (XP + vdmsound + DOSBox when necessary).
** It was the only one that didn't randomly crash and/or eat files on the HD, but that may have been due to the filesystem. I dunno. It got pretty frustrating having Mandrake hard crash every couple hours, deleting some files that were in-use every time it did that, and having it lock up the computer whenever it tried to reboot. (I tried Gentoo after Mandrake deleted files that were critical for X to work - twice)
XP has basically been far more reliable than any of the linuxes I tried. Gentoo wasn't crashing, but it eventually b0rked itself so badly that even repartitioning and reinstalling from the beginning didn't make it bootable - of course this was due to me trying something that should have been impossible: Logging in while the computer was shutting down... I wanted to cancel the shutdown, and couldn't very well enter commands while logged out. So I attempted to log back in! It sort of worked, and then Linux went insane.
[ June 22, 2007: Message edited by: Shadowlord ]