Toggle theme
Kacper's Wiki
Narzędzia użytkownika
Toggle theme
Zaloguj
Narzędzia witryny
Szukaj
Narzędzia
Pokaż stronę
Poprzednie wersje
Export to PDF
Odnośniki
Ostatnie zmiany
Menadżer multimediów
Indeks
Zaloguj
>
Ostatnie zmiany
Menadżer multimediów
Indeks
Ślad:
narzedzia:7z_backup_bat
Ta strona jest tylko do odczytu. Możesz wyświetlić źródła tej strony ale nie możesz ich zmienić.
=== BAT: Szyfrowane backupy za pomocą 7z i batcha === <code batch backup.bat> @echo off setlocal enabledelayedexpansion REM Set the source and destination directories set "sourceDir=A:\" set "destinationDir=B:\" REM Get the current date in the format DD.MM.YYYY for /f "tokens=1-3 delims=." %%a in ('echo %date%') do ( set "currentDate=%%a.%%b.%%c" ) REM Set the password for encryption set "password=PUT PASSWORD HERE" REM Set the output file name with the current date set "outputFileName=backup_%currentDate%.zip" REM Create the ZIP archive with encryption 7z a -tzip -p"%password%" "%destinationDir%\%outputFileName%" "%sourceDir%\*" REM Check if the ZIP operation was successful if %errorlevel% equ 0 ( echo Archive creation successful. REM Optional: Delete the original files in the source directory REM del /q "%sourceDir%\*" REM Optional: Move the encrypted archive to the destination directory move /y "%outputFileName%" "%destinationDir%\" echo Move successful. ) else ( echo Archive creation failed. ) endlocal </code>
narzedzia/7z_backup_bat.txt
· ostatnio zmienione: 2025/05/16 18:49 przez
administrator
Narzędzia strony
Pokaż stronę
Poprzednie wersje
Odnośniki
Export to PDF
Do góry