#!/bin/sh #-----------------------# #       Konfigurace     # #-----------------------# LOCAL_BACKUP_DIR="/backup"                      # Lokalni slozka pro zalohy s koncovym lomitkem (/home/backup/) OF=$LOCAL_BACKUP_DIR/*.bak                      # jmeno souboru se zalohou KEY="/backup/.ssh/id_rsa"                       # cesta k ssh klici pro prihlaseni na backupserver HOST="172.27.x.x" REMOTE_BACKUP_DIR="./G3-engine-backup/"                # tento adresar musi na cilovem serveru jiz existovat #---------------------------------------# #       Provest zalohu enginu           # #---------------------------------------# /usr/bin/engine-backup --mode=backup --scope=all --file=/backup/$(date +"%Y-%m-%d")_G3-engine-backup.bak --log=/var/log/engine-backup/$(date +"%Y-%m-%d")_engine-backup.log #---------------------------------------# #       Kopirovat zalohu na server      # #---------------------------------------# /usr/bin/scp -i $KEY $OF $USER@$HOST:$REMOTE_BACKUP_DIR #-----------------------------------------------# #       Uklid Starych lokalnich souboru         # #-----------------------------------------------# /bin/rm $OF