Это код скриптов для статьи Бэкап - как много в этом звуке! (https://author.today/post/148535)
Last active
March 7, 2021 21:29
-
-
Save KarelWintersky/7bb1fe0bf4d15e1df2d95d2c4143a085 to your computer and use it in GitHub Desktop.
Код скриптов к статье "Бэкап - как много в этом звуке!" (https://author.today/post/148535)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
REM --- set options --- | |
SET RCLONE_CONFIG_PATH=c:\rclone.conf | |
SET BACKUP_SOURCE=c:\WORKSPACE\ | |
SET CLOUD_NAME=selectel | |
SET CONTAINER_NAME=MY_BACKUP | |
REM --- do magic --- | |
@ECHO ON | |
rclone sync --config %RCLONE_CONFIG_PATH% -LPuv %BACKUP_SOURCE% %CLOUD_NAME%:%CONTAINER_NAME% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
REM --- set options --- | |
SET RCLONE_CONFIG_PATH=c:\rclone.conf | |
SET BACKUP_SOURCE=c:\WORKSPACE\ | |
SET CLOUD_NAME=selectel | |
SET CONTAINER_NAME=MY_BACKUP | |
REM --- do magic --- | |
FOR /F "skip=1" %%D IN ('WMIC OS GET LocalDateTime') DO (SET LIDATE=%%D & GOTO :GOT_LIDATE) | |
:GOT_LIDATE | |
SET DATETIME=%LIDATE:~0,4%-%LIDATE:~4,2%-%LIDATE:~6,2%-%LIDATE:~8,2%-%LIDATE:~10,2%-%LIDATE:~12,2% | |
@ECHO ON | |
rar a -m5 -mde -r d:\backup_%DATETIME%.rar %BACKUP_SOURCE% | |
rclone sync --config %RCLONE_CONFIG_PATH% -LPuv d:\backup_%DATETIME%.rar %CLOUD_NAME%:%CONTAINER_NAME% | |
del d:\backup_%DATETIME%.rar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[selectel] | |
type = swift | |
env_auth = false | |
user = XXXXX_MY_BACKUPPER | |
key = My1st=SecurePass | |
auth = https://auth.selcdn.ru/v1.0 | |
endpoint_type = private |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment