#!/bin/sh
set -eux

mysql_user='root'
mysql_pass='<%= @mysql_password -%>'
sqlbackup_path='/backup/mysql/'
gitbackup_path='/backup/git/'
configsbackup_path='/backup/configs/'
wwwbackup_path='/backup/www/'

mysql -u${mysql_user} -p${mysql_pass} < ${sqlbackup_path}all_dbs_last.sql

rsync -va --delete --delete-after /backup/cyrus-imapd/var/lib/imap/ /var/lib/imap/
rsync -va --delete --delete-after /backup/cyrus-imapd/var/spool/imap/ /var/spool/imap/
chmod -R cyrus:mail /var/lib/imap/
chmod -R cyrus:mail /var/spool/imap/

sa-learn --restore /backup/bayees.backup

tar -xvf ${gitbackup_path}git_last.tar.gz -C /

tar -xvf ${configsbackup_path}sasldb_last.tar.gz -C /

tar -xvf ${wwwbackup_path}http_sites_last.tar.gz -C /

#!/bin/sh
set -eux

mysql_user='root'
mysql_pass='<%= @mysql_password -%>'
sqlbackup_path='/backup/mysql/'
gitbackup_path='/backup/git/'
configsbackup_path='/backup/configs/'
wwwbackup_path='/backup/www/'

mysql -u${mysql_user} -p${mysql_pass} < ${sqlbackup_path}all_dbs_last.sql

rsync -va --delete --delete-after /backup/cyrus-imapd/var/lib/imap/ /var/lib/imap/
rsync -va --delete --delete-after /backup/cyrus-imapd/var/spool/imap/ /var/spool/imap/
chown -R cyrus:mail /var/lib/imap/
chown -R cyrus:mail /var/spool/imap/

sa-learn --restore /backup/bayees.backup

tar -xvf ${gitbackup_path}git_last.tar.gz -C /

tar -xvf ${configsbackup_path}sasldb_last.tar.gz -C /

tar -xvf ${wwwbackup_path}http_sites_last.tar.gz -C /

Fix chmod to chown for setting owner of cyrus files
Fix chmod to chown for setting owner of cyrus files
