#!/bin/bash make_slave_backup() { generate_load 5 if (( pg_major_version >= 9 )) then /opt/omnipitr/bin/omnipitr-backup-slave -P 54001 -cm -s gzip=/home/depesz/omnipitr/archive -p /home/depesz/omnipitr/pause.master-slave -t /home/depesz/omnipitr/tmp/backup-slave/ -D /home/depesz/data-master-slave/ -dl gzip=/home/depesz/omnipitr/backup/ -f "master-slave-__FILETYPE__.tar__CEXT__" -l /home/depesz/omnipitr/log-backup-slave -v else /opt/omnipitr/bin/omnipitr-backup-slave -s gzip=/home/depesz/omnipitr/archive -p /home/depesz/omnipitr/pause.master-slave -t /home/depesz/omnipitr/tmp/backup-slave/ -D /home/depesz/data-master-slave/ -dl gzip=/home/depesz/omnipitr/backup/ -f "master-slave-__FILETYPE__.tar__CEXT__" -l /home/depesz/omnipitr/log-backup-slave -v fi stop_load_generators if [[ ! -e /home/depesz/omnipitr/backup/master-slave-data.tar.gz ]] then echo "/home/depesz/omnipitr/backup/master-slave-data.tar.gz does not exist?!" >&2 exit 1 fi if [[ ! -e /home/depesz/omnipitr/backup/master-slave-xlog.tar.gz ]] then echo "/home/depesz/omnipitr/backup/master-slave-xlog.tar.gz does not exist?!" >&2 exit 1 fi data_size="$( du -k /home/depesz/omnipitr/backup/master-slave-data.tar.gz | awk '{print $1}')" xlog_size="$( du -k /home/depesz/omnipitr/backup/master-slave-xlog.tar.gz | awk '{print $1}')" if (( $data_size < 1024 )) then echo "/home/depesz/omnipitr/backup/master-slave-data.tar.gz exists but looks too small to be sensible!" >&2 exit 1 fi if (( $xlog_size < 8 )) then echo "/home/depesz/omnipitr/backup/master-slave-xlog.tar.gz exists but looks too small to be sensible!" >&2 exit 1 fi }