You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
420 B
Bash
19 lines
420 B
Bash
#!/bin/bash
|
|
#
|
|
#
|
|
#
|
|
|
|
REMOTE_SYSTEM_USER=backupuser
|
|
DATABASE_SERVER_IP=$1
|
|
STAGE=$2
|
|
DATABASE_ENGINE=$3
|
|
DEST_DIR=${HOME}/backups/${STAGE}/${DATABASE_ENGINE}/
|
|
|
|
# remove files oder than XX in backup-DIR
|
|
find ${DEST_DIR} -type f -mtime +2 -delete
|
|
|
|
mkdir -p ${DEST_DIR}
|
|
rsync -av --remove-source-files -e "ssh -o StrictHostKeyChecking=no" ${REMOTE_SYSTEM_USER}@${DATABASE_SERVER_IP}:/backups/${DATABASE_ENGINE}/* ${DEST_DIR}/
|
|
|
|
|