Software-OK
≡... News | ... Home | ... FAQ | Impressum | Contact | Listed at | Thank you |

  
HOME ► Faq ► FAQ - Command Prompt - Windows 11, 10, etc. ► ««« »»»

Use ROBOCOPY to backup files with examples in the CMD?


ROBOCOPY (Robust File Copy) is a powerful Windows command line tool used to copy files and directories. It is particularly well suited for creating backups as it offers various options to control and customize the copying. Here are some examples of how ROBOCOPY can be used for backups:



1. Simple backup of files and directories:
2. Backup with log file:
3. Differential backup (changed files only):
4. Network backup with retries on errors:
5. Exclude specific file types:
6. Backup with file and directory exclusions:
7. Mirroring a directory without deleting:
8. Copying files modified after a specific date:
9. Running backup every x minutes:
10. Mirror a directory and delete orphaned files in the destination:

11. Conclusion on backup with ROBOCOPY!





1.) Simple backup of files and directories:



A simple backup of a source (C:\SourceDirectory) to a destination directory (D:\BackupDirectory):

ROBOCOPY C:\SourceDirectory D:\BackupDirectory /E

- /E: Copies all subdirectories, including empty directories.

2.) Backup with log file:



To create a backup and generate a log file (backup.log) at the same time:

ROBOCOPY C:\SourceDirectory D:\BackupDirectory /E /LOG:C:\Logs\backup.log

- /LOG:<filepath>: Saves the log information to the specified file.

3.) Differential backup (changed files only):



A backup that only copies files that are new or changed:

ROBOCOPY C:\SourceDirectory D:\BackupDirectory /MIR

- /MIR: Mirrors a directory tree by copying new and changed files and deleting obsolete files in the destination.

4.) Network backup with retries on errors:



A backup over a network with retries on network errors:

ROBOCOPY \\Server\Share\SourceDirectory D:\BackupDirectory /E /Z /R:5 /W:10

- /Z: Copies files in "restartable mode", which allows an interrupted copy process to be continued.
- /R:n: Number of retries (here 5) on errors.
- /W:n: Waiting time (here 10 seconds) between retries.

5.) Exclude specific file types:



To exclude specific file types such as .tmp or .log from backup:

ROBOCOPY C:\SourceDirectory D:\BackupDirectory /E /XF *.tmp *.log

- /XF <filepattern>: Excludes files with the specified patterns from copying.

6.) Backup with file and directory exclusions:



To exclude specific directories and files:

ROBOCOPY C:\SourceDirectory D:\BackupDirectory /E /XD C:\SourceDirectory\ExcludedDirectory /XF *.bak

- /XD <directorypattern>: Excludes specific directories.
- /XF <filepattern>: Excludes specific files.

7.) Mirroring a directory without deleting:



A backup that copies files and directories but does not delete files in the destination that no longer exist in the source:

ROBOCOPY C:\SourceDirectory D:\BackupDirectory /E /COPYALL /B /R:3 /W:5

- /COPYALL: Copies all file attributes.

- /B: Copies files in backup mode (requires administrator privileges).

8.) Copying files modified after a specific date:



A backup that only copies files modified after a specific date:

ROBOCOPY C:\SourceDirectory D:\BackupDirectory /E /MAXAGE:20230801

- /MAXAGE:<date>: Excludes files modified before the specified date (in YYYYMMDD format).

9.) Running backup every x minutes:



A running backup that runs every 10 minutes:

ROBOCOPY C:\SourceDirectory D:\BackupDirectory /E /MON:1 /MOT:10

- /MON:n: Monitors the number of changes (here at least 1).

- /MOT:m: Reruns the backup after the specified time (here 10 minutes) if changes are detected.

10.) Mirror a directory and delete orphaned files in the destination:



A full mirror of a directory, deleting files in the destination that no longer exist in the source:

ROBOCOPY C:\SourceDirectory D:\BackupDirectory /MIR /PURGE

- /PURGE: Removes files in the destination that no longer exist in the source.

With these examples, ROBOCOPY can be flexibly adapted to different backup requirements.

11.) Conclusion on backup with ROBOCOPY!



ROBOCOPY is an extremely powerful and flexible tool for creating backups under Windows. It offers numerous options to tailor the copying of files and directories to your own needs. Whether simple file backups, differential backups, network backups or the targeted exclusion of certain files and folders - ROBOCOPY can handle all of this efficiently.

Particularly noteworthy is ROBOCOPY's ability to perform backups quickly and reliably, even with large amounts of data and under difficult conditions such as network interruptions. The ability to create detailed logs and configure specific backup scenarios makes it an indispensable tool for IT professionals and power users.


In summary, ROBOCOPY is an excellent choice for anyone who wants to make their Windows backups effective and flexible. It offers a robust solution for regular backups while ensuring data security and integrity.




FAQ 162: Updated on: 29 August 2024 19:10 Windows
Windows-Console

Use XCOPY to backup files with examples in the CMD?


With XCOPY you can backup a directory and its subdirectories in several ways. Here are some examples: 1. Simple backup of a directory and its subdirectories:
Windows-Console

Extract CAB file via command prompt?


To extract a CAB Cabinet file using the command prompt, you can use the built-in expand tool in Windows. Heres how to do it: 1. Unpacking the CAB file
Windows-Console

Managing Windows images and repairing the system?


Managing Windows images and repairing the system using the Command Prompt can be useful in various scenarios, especially when performing maintenance, deployment,
Windows-Console

How is powercfg used to configure power options in Windows?


Here are the most important questions and answers on the topic "What is powercfg suitable for to configure the power options in Windows?" divided into categories
Windows-Console

Keyboard queries command prompt scripts CMD!?


Ability to process keystrokes in a CMD script or command prompt. There is no direct way to capture keystrokes in the Windows Command Prompt CMD without
Windows-Console

Check if input is a number in command prompt script!?


To check if the input is a number, you can do a simple check using if and a regular expression RegEx in a batch script. However, there is no direct support
Windows-Console

Proper reboot and shutdown via command prompt?


A Windows computer can be shut down or restarted quickly and efficiently using the command prompt. This method is especially useful when other control methods

»»

  My question is not there in the FAQ
Asked questions on this answer:
  1. How do I use ROBOCOPY on Windows 11 to create a backup over a network?
  2. How do I backup network drives on Windows 11 using ROBOCOPY?
  3. How do you create a network backup with ROBOCOPY on Windows 11?
  4. How do I use ROBOCOPY on Windows 12 to exclude certain directories?
  5. How do I use ROBOCOPY on Windows 12 to create a full backup?
  6. How do I use ROBOCOPY on Windows 10 to run a continuous backup every 10 minutes?
  7. How do I perform a mirror of a directory using ROBOCOPY on Windows 12?
  8. How do I create a differential backup with ROBOCOPY on Windows 10?
  9. How can I use ROBOCOPY on Windows 11 to copy files and log errors at the same time?
  10. What is the difference between the /MIR and /E commands in ROBOCOPY on Windows 11?
  11. How do I create a backup that is updated regularly using ROBOCOPY on Windows 10?
  12. How do I use ROBOCOPY on Windows 10 to copy empty directories?
  13. How do I perform a backup using ROBOCOPY on Windows 11 without deleting files in the destination?
  14. How can I use ROBOCOPY on Windows 12 to exclude files older than a certain date?
  15. How can I configure ROBOCOPY on Windows 12 to only copy new or changed files?
  16. How can I use ROBOCOPY on Windows 12 to create a log file?
  17. How can I use ROBOCOPY on Windows 10 to remove files in the destination directory that no longer exist in the source?
  18. How do I copy files with ROBOCOPY on Windows 12 and exclude certain directories?
  19. How can I use the /LOG parameter in ROBOCOPY on Windows 12?
  20. How do I set ROBOCOPY on Windows 10 to copy only changed files?
  21. How do I use the /Z parameter in ROBOCOPY on Windows 10?
  22. How can I use ROBOCOPY on Windows 11 to copy files in a directory tree?
  23. How do I copy files that were modified after a certain date with ROBOCOPY on Windows 12?
  24. What are the most important parameters for ROBOCOPY on Windows 12?
  25. What is the command to copy all files in a directory with ROBOCOPY on Windows 10?
  26. What commands do I need for a differential backup with ROBOCOPY on Windows 10?
  27. How do I use ROBOCOPY on Windows 10 to copy files with a log file?
  28. How can I copy files using ROBOCOPY in backup mode on Windows 11?
  29. What does the /PURGE parameter do in ROBOCOPY on Windows 10?
  30. How do I use ROBOCOPY on Windows 11 to mirror a directory?
  31. How do I perform a running backup with ROBOCOPY on Windows 11?
  32. How can I use ROBOCOPY on Windows 10 to copy files after a specific date?
  33. How do I configure ROBOCOPY on Windows 11 to create a continuous backup?
  34. How can I create a simple backup with ROBOCOPY on Windows 11?
  35. How do I create a differential backup with ROBOCOPY on Windows 12?
  36. How do I use ROBOCOPY on Windows 10 to copy files in "restartable mode"?
  37. How can I create a backup with a log file with ROBOCOPY on Windows 11?
  38. How do I perform a backup excluding certain files on Windows 11?
  39. How do I use ROBOCOPY on Windows 10 to copy files in backup mode?
  40. How many times can ROBOCOPY on Windows 12 copy a file before it gives up?
  41. What are the best ROBOCOPY parameters for a network backup on Windows 12?
  42. How do I use ROBOCOPY on Windows 11 to delete files in the destination directory that no longer exist in the source?
  43. How can I create a log file for a network backup using ROBOCOPY on Windows 10?
  44. How do I back up files on Windows 11 that were modified after a certain date?
  45. How can I set up ROBOCOPY for backup over a network on Windows 11?
  46. How do I use ROBOCOPY on Windows 12 to copy files?
  47. How can I mirror a directory and delete orphaned files on the destination using ROBOCOPY on Windows 12?
  48. How do I delete orphaned files in the target directory using ROBOCOPY on Windows 12?
  49. How do I mirror a directory using ROBOCOPY on Windows 10?
  50. How can I exclude certain file types from the backup with ROBOCOPY on Windows 12?
Keywords: windows, 12, 11, 10, server, console, robocopy, backup, files, with, examples, robust, file, copy, powerful, command, line, tool, used, directories, particularly, well, suited, creating, backups, Questions, Answers, Software




  

  + Freeware
  + Order on the PC
  + File management
  + Automation
  + Office Tools
  + PC testing tools
  + Decoration and fun
  + Desktop-Clocks
  + Security

  + SoftwareOK Pages
  + Micro Staff
  + Freeware-1
  + Freeware-2
  + Freeware-3
  + FAQ
  + Downloads

  + Top
  + Desktop-OK
  + The Quad Explorer
  + Don't Sleep
  + Win-Scan-2-PDF
  + Quick-Text-Past
  + Print Folder Tree
  + Find Same Images
  + Experience-Index-OK
  + Font-View-OK


  + Freeware
  + Delete.On.Reboot
  + IsMyTouchScreenOK
  + Print.Test.Page.OK
  + OpenCloseDriveEject
  + ColorConsole
  + IsMyLcdOK
  + DesktopDigitalClock
  + ClassicDesktopClock
  + PreventTurnOff
  + PAD-s


Home | Thanks | Contact | Link me | FAQ | Settings | Windows 10 | gc24b | English-AV | Impressum | Translate | PayPal | PAD-s

 © 2025 by Nenad Hrg softwareok.de • softwareok.com • softwareok.com • softwareok.eu


► Keep the Mouse Speed on all Windows OS! ◄
► Automatic adjustment of energy options under Windows! ◄
► StressTheGPU - Powerful stress tester for 3D graphics cards!?  ◄
► PowerShell desktop shortcut on Windows 11! ◄


This website does not store personal data. However, third-party providers are used to display ads,
which are managed by Google and comply with the IAB Transparency and Consent Framework (IAB-TCF).
The CMP ID is 300 and can be individually customized at the bottom of the page.
more Infos & Privacy Policy

....