Friday, August 23, 2013

..::: How to Create a Backup Script Using the ROBOCOPY & Scheduling On Windows :::.

ROBOCOPY can be likened to an extension of XCOPY on steroids. Some of the more important features that make ROBOCOPY an attractive backup alternative are:
  • multi-threaded copying
  • mirroring or synchronisation mode between the destination and source
  • automatic retry and copy resumption
Applies To : Windows 7, Windows 8, Windows Server 2008, Windows Server 2012
Type : Copies file data.

A. Create Script Backup Using ROBOCOPY

1. Check Destination Address Backup Before run Script.bat

 

2. Check Source Address Backup Before run Script.bat

3. Open Notepad a new blank Notepad document & Type ROBOCOPY command
syntak
=================================
robocopy <source> <destination> <options>
=================================

Command to Copy Data (This Case)
robocopy D:\backup\TeguhTh\source-robocopy Z:\destination-robocopy /e /mir /np /z /tee /log+:backup_log.txt
pause

Command to Move Data
robocopy D:\backup\TeguhTh\source-robocopy Z:\destination-robocopy /e /mir /move /np /z /tee /log+:backup_log.txt
pause

4. Then save as format .bat file. example autobackup_script.bat


5. Open autobackup_script.bat


6. Check Result & Backup_log.txt if need

7. Check Destination Address Backup After run Script.bat




B. Scheduling Autobackup_script.bat using Task Scheduler Windows
1. Open Control Panel -> Administrative Tools


2. Push Button Create Basic task with wizard

3. At Create a Basic Task, Fill Name = Schedule-autoback_script & next

4. at Task Trigger, select Weekly
5. at Weekly, fill form example 2 week on Saturday 7/11/2012 6:00 PM


6. at Action, select Start a Program

7. select autobackup_script.bat

8. Start a Program, fill Add arguments(optional)= and start in(optional)

9. At finish, check Open the Properties dialog for this task when I click finish






other robocopy 

 robocopy C:\tmp D:\software AlmaLinux-8.10-x86_64-minimal.iso /MOV /Z /R:3 /W:5

 c:\>robocopy C:\tmp D:\software AlmaLinux-8.10-x86_64-minimal.iso /MOV /Z /R:3 /W:5

-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------

  Started : Friday, March 13, 2026 9:17:49 AM
   Source : C:\tmp\
     Dest : D:\software\

    Files : AlmaLinux-8.10-x86_64-minimal.iso

  Options : /DCOPY:DA /COPY:DAT /MOV /Z /R:3 /W:5

------------------------------------------------------------------------------

                           1    C:\tmp\
100%        New File               1.9 g        AlmaLinux-8.10-x86_64-minimal.iso

------------------------------------------------------------------------------

               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         1         1         0         0         0         0
   Bytes :   1.993 g   1.993 g         0         0         0         0
   Times :   0:00:04   0:00:04                       0:00:00   0:00:00


   Speed :           463,334,837 Bytes/sec.
   Speed :            26,512.232 MegaBytes/min.
   Ended : Friday, March 13, 2026 9:17:53 AM


c:\>

 


 

1 comment:

  1. I got here much interesting stuff. The post is great! Thanks for sharing it! Robocopy

    ReplyDelete