@echo off setlocal enabledelayedexpansion set "HERE=%~dp0" set "RESTIC=%HERE%..\bin\restic.exe" set "RESTIC_REPOSITORY=D:\backups\restic-repo" set "RESTIC_PASSWORD_FILE=%HERE%..\secrets\restic_password" set "EXCLUDE_FILE=%HERE%backup_exclusions.txt" if not exist "%RESTIC_REPOSITORY%\config" ( echo Repository non trovato, inizializzo %RESTIC_REPOSITORY% "%RESTIC%" init ) "%RESTIC%" backup "I:\lavori" "I:\SOFTWARE" "I:\Budget" "W:\GemmaLoader" "X:\MonitorOsservatorio" --exclude-file="%EXCLUDE_FILE%" set "BACKUP_ERR=%ERRORLEVEL%" "%RESTIC%" forget --keep-daily 7 --keep-weekly 4 --keep-monthly 12 --prune for /f %%D in ('powershell -NoProfile -Command "(Get-Date).DayOfWeek"') do set "DOW=%%D" if /I "%DOW%"=="Sunday" ( echo Controllo integrita' settimanale "%RESTIC%" check ) endlocal & exit /b %BACKUP_ERR%