Skip to content

Instantly share code, notes, and snippets.

@christianrickert
Created November 28, 2022 19:31
Show Gist options
  • Save christianrickert/eb220706346c743ba94b0ced5456d002 to your computer and use it in GitHub Desktop.
Save christianrickert/eb220706346c743ba94b0ced5456d002 to your computer and use it in GitHub Desktop.
(Windows) restic backup to a network drive
@ECHO OFF
TITLE Restic backup
:: mount network drive for Administrator command prompt
NET USE Z: \\data.server.pvt\your\data
:: manually create remote restic repository with (optional) compression
:: restic.exe init --repo "Z:\repo" --repository-version latest
:: set RESTIC_PASSWORD system variable before accessing repository
CMD /C START "Restic backup [C:\]" /BELOWNORMAL /WAIT restic.exe backup --repo "Z:\repo" --compression off --use-fs-snapshot --verbose C:\
CMD /C START "Restic backup [D:\]" /BELOWNORMAL /WAIT restic.exe backup --repo "Z:\repo" --compression off --use-fs-snapshot --verbose D:\
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment