1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| @title CK backup start @echo off setlocal enabledelayedexpansion @color 0a :: --------------------参数设置------------------------ :: 设置时间变量 echo --------------------CK备份开始--------------------
set YEAR=%date:~0,4% set MONTH=%date:~5,2% set DAY=%date:~8,2% :: 如果在 dos 下输入 time 返回的不是 24 小时制(没有 0 填充),请自行修改此处 set HOUR=%time:~0,2% set MINUTE=%time:~3,2% set SECOND=%time:~6,2%
set "Ymd=%YEAR%%MONTH%%DAY%"
docker exec -it --user root 800d5e4b1667 bash -c " clickhouse-client --user=default --password=111111 --query=\"SELECT * FROM test INTO OUTFILE '/var/log/clickhouse-server/test%Ymd%.binary' FORMAT RowBinary\" "
:: --------------------结束备份------------------------ @echo on
|