Skip to content

Instantly share code, notes, and snippets.

@DominikStyp
Last active September 25, 2022 22:39
Show Gist options
  • Save DominikStyp/8b8e0d7ee04640e894e8ffda4519fc4c to your computer and use it in GitHub Desktop.
Save DominikStyp/8b8e0d7ee04640e894e8ffda4519fc4c to your computer and use it in GitHub Desktop.
Batch (Windows): make directories backups with robocopy
REM cmd /c invokes command in CMD
REM cd /d J:\VIDEOS\ goes to the directory where the backup script lives
REM make-backup.bat invokes the backuping script in that directory
REM make backup for VIDEOS at disk J
cmd /c "cd /d J:\VIDEOS\ && dir && make-backup.bat"
REM make backup for VIDEOS at disk K
cmd /c "cd /d K:\VIDEOS\ && dir && make-backup.bat"
REM /MIR mirror backup, /R:5 5 retries, %cd% = current directory
REM COPY ALL THE FILES & DIRS IN THE CURRENT DIR TO "F:\VIDEOS_BACKUP"
robocopy "%cd%" "F:\VIDEOS_BACKUP" /MIR /R:5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment