nurjns icon

Restic Backup-Script

nurjns | PRO | 12/17/24 11:09:10 AM UTC (Edited) | 0 ⭐ | 8427 👁️ | Never ⏰ | []
Batch |

1.05 KB

|

None

|

0 👍

/

0 👎

:: restic.exe muss sich in "C:\Windows\System32\" befinden
 
@echo off
:menu
cls
echo Bitte Menuepunkt waehlen:
echo.
echo 1. Repository anlegen
echo 2. Backup erstellen
echo 3. Backup wiederherstellen
echo 4. Beenden
 
set /p choice=Deine Auswahl:
 
if "%choice%"=="1" goto create_repo
if "%choice%"=="2" goto create_backup
if "%choice%"=="3" goto restore_backup
if "%choice%"=="4" goto end
 
:create_repo
set /p repo_path=Gib den Pfad zur Repository an:
restic -r %repo_path% init
pause
goto menu
 
:create_backup
set /p repo_path=Gib den Pfad zur Repository an:
set /p backup_path=Gib den Pfad zum Verzeichnis an, das gesichert werden soll:
restic -r %repo_path% backup %backup_path%
pause
goto menu
 
:restore_backup
set /p repo_path=Gib den Pfad zur Repository an:
restic -r %repo_path% snapshots
 
set /p snapshot_id=Gib die Snapshot-ID zum Wiederherstellen an:
set /p restore_path=Gib den Pfad zum Verzeichnis an, in das wiederhergestellt werden soll:
 
restic -r %repo_path% restore %snapshot_id% -t %restore_path%
pause
goto menu
 
:end

Comments