In this lesson we are going to learn how can we create automatic backups for our files, specially those files that change on daily basis.
- Install WinRar in your machine.
it provides a command line tool (rar.exe) in which we can compress files from the Command Line Prompt. - Open a new empty text file [via notepad], and save it with extension (.bat) on your disk.
- Fill the file with the following command.
[rar.exe location] a -ep1 -r [Compressed File Location] [Your Project Folder] - As Example, suppose I have a project on my local machine at [C:\MyProject], and I want to write the command above, of course I will add the date attached to my project name to make sure it has a unique name, then the command would be like:
"C:\Program Files\WinRAR\Rar.exe" a -ep1 -r MyProject_%date:~-4%%date:~4,2%%date:~7,2%_0%time:~1,1%%time:~3,2%%time:~6,2%.rar "C:\MyProject" - Open Windows Task Scheduler
- Click on "Create Basic Task..." from the right upper menu
- Fill in the task name as shown below:
- Click on "Next", then choose "When" you want the task to start, you have 7 choices to select from.
- Click on "Next", then specify the exact time that you want to run the task.
- Click on "Next", then choose to "Start a program"
- Click on "Next", then Select the (.bat) file that we just created.
- Click twice on Next until you reach the last screen in the wizard.
- Click on Finish.
No comments:
Post a Comment