Restic-Windows-Binary herunterladen von https://github.com/restic/restic/releases/ und nach c:\windows\restic.exe kopieren
Das Restic-Passwort als c:\users\<benutzername>\restic-password.txt abspeichern
Restic mit allen Parametern wird über eine Batch-Datei gestartet
echo off cd %appdata% c:\windows\restic.exe backup --password-file c:\users\<benutzername>\restic-password.txt -r rest:https://<abc>:<xyz>@restic.hermes.markus-spring.info -v --use-fs-snapshot --host <hostname> --exclude-caches c:\users\<benutzername>\
Die Aufgabenplanung braucht Unterstützung von einer cmd/bat-Datei, um sicherzustellen, dass das Backup nur einmal täglich ausgeführt wird.
@echo off
setlocal EnableDelayedExpansion
for /f "delims=" %%x in (c:\windows\restic_last_run.txt) do set lastRun=%%x
set myRun=
for /f "tokens=2 delims==" %%a in ('wmic os get localdatetime /value') do set "myRun=%%a"
set "myRun=%myRun:~0,8%"
set "myRun=%myRun:~6%%myRun:~4,2%%myRun:~0,4%"
if defined lastRun if "%lastRun%"=="%myRun%" exit /b
echo now running restic %myRun% %lastRun%
c:\windows\restic_backup.cmd
rem Kein Leerzeichen zwischen % und größer, sonst funktioniert der Vergleich nicht!!!
echo %myRun%> c:\windows\restic_last_run.txt
Ein lokaler Backupserver kann entweder über lokales DNS (pihole) oder auf jedem Windows-Client in der hosts-Datei bekanntgegeben werden.
# localhost name resolution is handled within DNS itself. # 127.0.0.1 localhost # ::1 localhost 192.168.178.124 yournamehere.local 192.168.178.124 restic.yournamehere.local 192.168.178.124 resticinfo.yournamehere.local 192.168.178.124 pihole.yournamehere.local