
This tutorial teaches you how to make your own backup program. Its nothing fancy like SVN or CVS but it does help you if you don’t have time to use something else (although i recommend you should make time)
Custom backup software are either very bad, expensive or too complicated for us. As developers, its our duty to backup our code all the time in case some major wastrel comes into stage. In case anything wrong goes with the deployment of a project or perhaps just a power loss during a simple upload on a server, you can have your work backed up and just revert to that version of the application. In the following lines, we will see how to write a very simple backup software (nothing fancy like SVN or any other tool) that will backup our files from day to day (or even more frequent). All you have to do is write two lines of code in a BAT file(or perhaps more if your project has different locations overall) and setup a simple Task Schedule.
The steps are simple:
- Create a file on your machine, named backup.bat..
- Right click on it and click EDIT
- Copy paste the following lines into it:
Echo Making Backup
mkdir "your_backup_path\backup\%DATE%" xcopy "path_to_project" "your_backup_path\backup\%DATE%" /E Echo Finish Pause- Now just go to control panel / task manager
- Setup a task to run every day (or anything you like) and point
the task to your BAT file.- You are done!
Make sure you schedule the task to run when you are not working (since it will backup your files with alterations of your current code).
If you want more paths, just include the xcopy command more and change your paths there.





