Ads 468x60px

Thursday, August 10, 2017

Create Daily Backup - Using Windows Tasks

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.


  1. Install WinRar in your machine.

    it provides a command line tool (rar.exe) in which we can compress files from the Command Line Prompt.
  2. Open a new empty text file [via notepad], and save it with extension (.bat) on your disk.
  3. Fill the file with the following command.
    [rar.exe location] a -ep1 -r [Compressed File Location] [Your Project Folder]
    1. 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"
  4. Open Windows Task Scheduler
     

  5.  Click on "Create Basic Task..." from the right upper menu
  6. Fill in the task name as shown below:

  7. Click on "Next", then choose "When" you want the task to start, you have 7 choices to select from.
  8. Click on "Next", then specify the exact time that you want to run the task.

  9. Click on "Next", then choose to "Start a program"
  10. Click on "Next", then Select the (.bat) file that we just created.
  11. Click twice on Next until you reach the last screen in the wizard.
  12. Click on Finish.


No comments:

Post a Comment