It has been running successfully but now after I installed Win10 anniversary update it only runs the first robocopy command (succesfully) on the list and not the remaining ones. The above procedure is for Windows Server 2003 but it’s also working for Windows 7.I have had a task in task scheduler for years that has a handful of robocopy commands with respective RJC files that backup my files to a NAS drive. By doing this the system will be able to execute our script even if we are not logged on. After that in the properties window set the password for your account.Before you press the finish button make sure that you have checked the box Open the Advanced Properties for this task when I click finish.Enter the info for your script and when you want it to run.For example, if our script is located in the C:myscriptbackup_script.bat you must enter in the Start in field this: C:myscript You must enter the path of your script otherwise it’s not going to work. Something very important here is the optional Start in field.Press Next and then Press the Browse button and select your batch script.Start->Programs-> Accessories->System Tools->Scheduled Tasks.The last thing we have to do is to create a task for our batch file. IF %ERRORLEVEL% = 0 ( MOVE "%USERPROFILE%Desktop*.rar" I:Backup So a small example for moving our backup in a network drive is this : NET USE I: Also you can add and network commands if you want to move your backup in a network drive or something. Of course you can change the script to fit your needs. You will find the archive and a text file that contains informations about the backup process to your desktop. The above script takes all the data from the C:data folder it compress them with the name databackup and appends to the name the year, month and day that was created. "%PROGRAMFILES%WinRARrar.exe" a -agYYYY-MM-dd -r "%USERPROFILE%Desktopdatabackup-.rar" "C:data"ĮCHO %date%, %time% : Backup succeeded > "%USERPROFILE%DesktopData_Backup_Log.txt"ĮCHO %date%, %time% : Backup succeeded with warnings > "%USERPROFILE%DesktopData_Backup_Log.txt"ĮCHO %date%, %time% : Backup failed > "%USERPROFILE%DesktopData_Backup_Log.txt" Here is a sample script that does the job. The best way to do this is to schedule a task in windows.Įnough with my story. After that, the only thing that left was to make this small batch file repeat itself once a week. I must admit that the manual of the WinRar is very good!Īs I found what I need (how to make a rar archive and append the year,month and day in the name of my archive) I start writing a batch file. I start searching about WinRar and I found that WinRar tool can be used in a terminal through the rar.exe plugin. What I had was a Windows system and the WinRar tool. When I say backup I mean to backup the data at least every week since it is not updated very often.īecause I don’t know if there is any worth free backup solution for Windows and because I prefer to learn something new I start thinking a way to automate the backup. When we finished the setup and the configuration the last thing we had to do was to find a way to backup our data. Although I prefer Linux, the server was running Windows 2003 so we had to go with this. The last week we setup an internal site for the needs of the company.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |