diff --git a/robocopy-bfds-offsite/bfds-offsite-backup.cmd b/robocopy-bfds-offsite/bfds-offsite-backup.cmd index f424e37..13bf10c 100644 --- a/robocopy-bfds-offsite/bfds-offsite-backup.cmd +++ b/robocopy-bfds-offsite/bfds-offsite-backup.cmd @@ -7,12 +7,26 @@ REM SMB Freigaben von bfds und xcopy. REM ************************************************** SETLOCAL + +REM ************************************************** +REM Einbinden der Veracrypt Partition +REM ************************************************** +echo Festplatte NASOFFSITE1 wird entschlüsselt und eingebunden +SET VOLUME_LABEL=NASOFFSITE1 +SET VERACRYPT_PATH="C:\Program Files\VeraCrypt\VeraCrypt.exe" +SET VOLUME_MOUNT_PATH="B:\" +SET VOLUME_PASSWORD=123456 +REM get the Password for the volume from the user +SET /P VOLUME_PASSWORD=Bitte geben Sie das Passwort für die Festplatte %VOLUME_LABEL% ein: +%VERACRYPT_PATH% /q /v "\Device\Harddisk2\Partition1" /l B /p "%VOLUME_PASSWORD%" + SET SOURCE=\\bfds SET DESTINATION="B:\\" echo Festplatte NASOFFSITE1 wird gesucht IF NOT EXIST %DESTINATION% ( - echo Festplatte NASOFFSITE1 nicht gefunden, bitte in Veracrypt als LAufwerk B:\ einbinden! + echo Festplatte NASOFFSITE1 nicht gefunden, bitte in Veracrypt als Laufwerk B:\ einbinden! + PAUSE exit /B ) @@ -29,6 +43,7 @@ REM Funktion zum Ausführen von robocopy SET COPYPATH=%~1 IF NOT EXIST %SOURCE%\%COPYPATH% ( echo Quelle nicht gefunden! Bitte öffne die SMB Freigbe: %SOURCE%\%COPYPATH% + PAUSE exit /B %ERRORLEVEL% ) SET SCRIPT_PATH=%~dp0 @@ -47,4 +62,9 @@ REM Funktion zum Ausführen von robocopy REM /LOG+: Protokolliert den Kopiervorgang in eine Datei REM /TEE: Protokolliert den Kopiervorgang auch in der Konsole GOTO :EOF -REM ************************************************** \ No newline at end of file +REM ************************************************** + +REM ************************************************** +REM Partiton wieder aushängen +REM ************************************************** +%VERACRYPT_PATH% /d B /q \ No newline at end of file