====== 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\\restic-password.txt abspeichern Restic mit allen Parametern wird über eine Batch-Datei gestartet ===== Restic-Start ===== echo off cd %appdata% c:\windows\restic.exe backup --password-file c:\users\\restic-password.txt -r rest:https://:@restic.hermes.markus-spring.info -v --use-fs-snapshot --host --exclude-caches c:\users\\ ===== 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. @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 ===== Die Aufgabenplanung wie folgt einrichten: {{:computer:restic:windows:pasted:20231108-082407.png}} {{:computer:restic:windows:pasted:20231108-082451.png}} {{:computer:restic:windows:pasted:20231108-082507.png}} {{:computer:restic:windows:pasted:20231108-082520.png}} ===== Hosts-Datei ===== 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