Windows-Rechner mit Restic sichern
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
Restic-Start
- c:\windows\restic_backup.cmd
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>\
Start 1x täglich
Die Aufgabenplanung braucht Unterstützung von einer cmd/bat-Datei, um sicherzustellen, dass das Backup nur einmal täglich ausgeführt wird.
- c:\windows\run_restic_once_day.bat
@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
Aufgabenplanung
Hosts-Datei
Ein lokaler Backupserver kann entweder über lokales DNS (pihole) oder auf jedem Windows-Client in der hosts-Datei bekanntgegeben werden.
- c:\windows\system32\drivers\etc\hosts
# 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



