Skip to content

Instantly share code, notes, and snippets.

@zeegin
Created August 22, 2019 20:53
Show Gist options
  • Save zeegin/781e69927c214a6703073f99bd5f7265 to your computer and use it in GitHub Desktop.
Save zeegin/781e69927c214a6703073f99bd5f7265 to your computer and use it in GitHub Desktop.
chcp 65001
set backup_path=E:\db\%DATE:~6,4%-%DATE:~3,2%-%DATE:~0,2% %TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%
mkdir "%backup_path%" > nul
pushd "ПОЛНЫЙ_ПУТЬ_К_ТЕКУЩЕЙ_ПАПКЕ"
call MakeBackup "%backup_path%\ИМЯ_АРХИВА.7z" D:\1C\db\ПАПКА_ИНФОРМАЦИОННОЙ_БАЗЫ ИМЯ_ПОЛЬЗОВАТЕЛЯ ПАРОЛЬ_ПОЛЬЗОВАТЕЛЯ >"%backup_path%\ИМЯ_АРХИВА.log"
popd
@echo off
chcp 65001 > nul
if /%1 == / goto help
pushd "C:\Program Files\1cv8\current\bin"
1cv8.exe ENTERPRISE /F %2 /N %3 /P %4 /WA- /AU- /DisableStartupMessages /C ЗавершитьРаботуПользователей
pushd %2
"C:\Program Files\7-Zip\7z.exe" a -t7z %1 1Cv8.1CD 1Cv8Log\* -ms -mmt
del 1Cv8.cdn
popd
popd
goto end
:help
echo MakeBackup - Make backup of infobase with locked sessions before
echo Parameter: backup_path db_path db_login db_pass
echo Example: MakeBackup E:\backup\trade.7z D:\1C\trade BackupUser BackupPassword
:end
@zeegin
Copy link
Author

zeegin commented Oct 26, 2023

а что есть [gistfile1.txt] или он должен был быть батником ?

Да, они оба батники

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment