From 0ec2c73ff98d4e8e64cf2937d02f09847ee510ce Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 31 Mar 2021 10:26:43 +0200 Subject: [PATCH] Implement Sybase database backup script --- scripts/sybase-backup.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 scripts/sybase-backup.sh diff --git a/scripts/sybase-backup.sh b/scripts/sybase-backup.sh new file mode 100644 index 0000000..1191df2 --- /dev/null +++ b/scripts/sybase-backup.sh @@ -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