Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
titlebackup-all.sh
#!/bin/sh

DATE=`date +%Y%m%d-%H%M%S`
OPTS='--events --routines --single-transaction'
TO=/backup

TO_MYSQL=$TO/mysql
mkdir -p $TO_MYSQL
mysqldump ${OPTS} -B ringme |gzip > $TO_MYSQL/ringme.${DATE}.sql.gz
mysqldump ${OPTS} --no-data -B ringme_log |gzip > $TO_MYSQL/ringme_log.${DATE}.sql.gz
mysqldump ${OPTS} -B client_interface |gzip > $TO_MYSQL/client_interface.${DATE}.sql.gz
mysqldump ${OPTS} --no-data -B teleoffice_stat |gzip > $TO_MYSQL/teleoffice_stat.${DATE}.sql.gz
mysqldump ${OPTS} --no-data -B teleo_stats |gzip > $TO_MYSQL/teleo_stats.${DATE}.sql.gz

TO_CBBACKUP=$TO/cbbackup
mkdir -p $TO_CBBACKUP
CB_PASS=$(grep -A 4100 '\[couchbase dumper]' /etc/ringme/main.cfg | grep password | head -n1 | awk -F "=" '{print $2}')
/opt/couchbase/bin/cbbackup couchbase://127.0.0.1:8091 $TO_CBBACKUP/$(date +%Y-%m-%d) -u Administrator -p $CB_PASS

TO_SOUNDS=$TO/sounds
mkdir -p $TO_SOUNDS
tar -czf $TO_SOUNDS/$DATE.tgz /var/lib/freeswitch/sounds

TO_RINGME=$TO/ringme
mkdir -p $TO_RINGME
cp /etc/ringme/main.cfg $TO_RINGME/$DATE.main.cnf

...