Surely, almost everyone has come across a situation where, when developing a project, you accidentally saved changes to a file by mistake, and you cannot cancel the action. For example, I once edited one image in Photoshop, and while saving inadvertently I chose to save a completely different file, rewriting it forever. It took an hour and a half to redraw the file, and all this is due to the fact that you cannot manually make backup copies every 20 seconds.
It was after this incident that I had the idea to write a program that would monitor the specified directory and its subdirectories every N seconds for adding new files and changing old ones. If there are new files or changes in the old ones, then it will make a backup copy of this file in the specified folder under the file_name date_time. In this scenario, losing any data will be difficult, because There is a complete history of all changes.
This program was written by me 2 years ago. She saved my projects more than once from various accidents, but quite recently I made several changes to it, and now I present it to you.
The program is written in Delphi. Just want to say that the quality of the code is simply disgusting, and there is no time to rewrite it all - because It performs its functions perfectly. I haven't written anything in Delphi for 2 years already, and I confess, I have lost the habit - the difference from PHP is huge.
')
This is what the main window of the program looks like.
And this is the directory where the copies are saved.
Personally, I prefer to upload copies to Dropbox - so surely, I won’t lose anything.
Above, I said that I recently made some changes. Specifically: he made it so that the program does not copy all files again with each new launch, but copies only the changed ones. To do this, in the folder where the backup copies are stored, it creates the lastScan_ [profile name] .ini file in which the file names and their md5 hashes are stored.
The program stores its settings in the registry. When monitoring is started, the “Close” button collapses the program into a tray. Otherwise, I think everything is clear and obvious.
I'd add that this is an indispensable thing for web development.
Download the source program here:
http://dl.dropbox.com/u/35608229/BackupMonitor.rar
http://narod.ru/disk/44036120001/BackupMonitor.rar.html
http://depositfiles.com/files/i9o9q17pg