backup-remote.sh 474 Bytes
Newer Older
1 2
#!/bin/bash

3 4 5 6 7 8
# This script is to be launched from an external backup server

# Local backup directory
DIR_BACKUP=/mnt/data/backup/vidjil/

# Remote server
9
ARCHIVE_DIR=/mnt/data/tmp
10
DATABASE_NAME=vidjil_bak
11

12
options=$1
13
filename=$(ssh ${VIDJIL_SERVER} "cd /home/vidjil/server; . /home/vidjil/virtualenv/bin/activate; sh ./backup.sh ${options} ${DATABASE_NAME} ${ARCHIVE_DIR}" | tail -1)
14
scp ${VIDJIL_SERVER}:${filename} ${DIR_BACKUP}
15

16
ssh ${VIDJIL_SERVER} "rm -f ${filename}"