Implement Sybase database backup script

This commit is contained in:
coolneng 2021-03-31 10:26:43 +02:00
parent e231fd0516
commit 0ec2c73ff9
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 19 additions and 0 deletions

19
scripts/sybase-backup.sh Normal file
View File

@ -0,0 +1,19 @@
#!/bin/sh
sybase_service() {
/etc/init.d/sybase "$1"
}
perform_backup() {
zip -r BBDD_"$(date +"%d%m%Y")".zip /opt/sybase
scp BBDD_"$(date +"%d%m%Y")".zip unit:/vault/sica
}
cleanup() {
rm BBDD_"$(date +"%d%m%Y")".zip
}
sybase_service stop
perform_backup
sybase_service start
cleanup