Local backups

This commit is contained in:
Bob Mottram 2016-07-07 20:42:25 +01:00
parent 0b54cf5641
commit 783d66fdf3
8 changed files with 398 additions and 343 deletions

View File

@ -46,13 +46,13 @@ function upgrade_mumble {
function backup_local_mumble { function backup_local_mumble {
if [ -f /etc/mumble-server.ini ]; then if [ -f /etc/mumble-server.ini ]; then
echo $"Backing up Mumble settings" echo $"Backing up Mumble settings"
if [ ! -d /root/tempvoipbackup ]; then temp_backup_dir=/root/tempvoipbackup
mkdir -p /root/tempvoipbackup if [ ! -d $temp_backup_dir ]; then
mkdir -p $temp_backup_dir
fi fi
cp -f /etc/mumble-server.ini /root/tempvoipbackup cp -f /etc/mumble-server.ini $temp_backup_dir
cp -f /var/lib/mumble-server/mumble-server.sqlite /root/tempvoipbackup cp -f /var/lib/mumble-server/mumble-server.sqlite $temp_backup_dir
cp -f /etc/sipwitch.conf /root/tempvoipbackup backup_directory_to_usb $temp_backup_dir voip
backup_directory_to_usb /root/tempvoipbackup voip
echo $"Mumble settings backup complete" echo $"Mumble settings backup complete"
fi fi
} }

View File

@ -42,7 +42,16 @@ function upgrade_sip {
} }
function backup_local_sip { function backup_local_sip {
echo -n '' if [ -f /etc/sipwitch.conf ]; then
echo $"Backing up SIP settings"
temp_backup_dir=/root/tempsipbackup
if [ ! -d $temp_backup_dir ]; then
mkdir -p $temp_backup_dir
fi
cp -f /etc/sipwitch.conf $temp_backup_dir
backup_directory_to_usb $temp_backup_dir sip
echo $"SIP settings backup complete"
fi
} }
function backup_remote_sip { function backup_remote_sip {

View File

@ -44,7 +44,15 @@ function upgrade_syncthing {
} }
function backup_local_syncthing { function backup_local_syncthing {
echo -n '' if [ -d /var/lib/syncthing/SyncShared ]; then
echo $"Backing up syncthing"
function_check backup_directory_to_usb
backup_directory_to_usb /var/lib/syncthing/SyncShared syncthingshared
backup_directory_to_usb /root/.config/syncthing syncthingconfig
echo $"Backup to syncthing complete"
fi
} }
function backup_remote_syncthing { function backup_remote_syncthing {

View File

@ -58,7 +58,21 @@ function upgrade_tox {
} }
function backup_local_tox { function backup_local_tox {
echo '' if [ -d /var/lib/tox-bootstrapd ]; then
echo $"Backing up Tox"
if [ -d /var/lib/tox-bootstrapd ]; then
cp /etc/tox-bootstrapd.conf /var/lib/tox-bootstrapd
if [ -d /var/lib/tox-bootstrapd/Maildir ]; then
rm -rf /var/lib/tox-bootstrapd/Maildir
fi
fi
function_check backup_directory_to_usb
backup_directory_to_usb /var/lib/tox-bootstrapd tox
echo $"Backup of Tox complete"
fi
} }
function backup_remote_tox { function backup_remote_tox {

View File

@ -31,15 +31,15 @@
VARIANTS='' VARIANTS=''
function upgrade_vpn { function upgrade_vpn {
echo '' echo -n ''
} }
function backup_local_vpn { function backup_local_vpn {
echo '' echo -n ''
} }
function backup_remote_vpn { function backup_remote_vpn {
echo '' echo -n ''
} }
function remove_vpn { function remove_vpn {

View File

@ -47,11 +47,16 @@ function upgrade_webmail {
} }
function backup_local_webmail { function backup_local_webmail {
echo '' echo $"Backing up webmail"
function_check backup_database_to_usb
backup_database_to_usb webmail
echo $"Backing up webmail complete"
} }
function backup_remote_webmail { function backup_remote_webmail {
echo '' echo -n ''
} }
function remove_webmail { function remove_webmail {
@ -65,7 +70,7 @@ function remove_webmail {
function_check remove_onion_service function_check remove_onion_service
remove_onion_service webmail ${WEBMAIL_ONION_PORT} remove_onion_service webmail ${WEBMAIL_ONION_PORT}
function_check drop_database function_check drop_database
drop_database webmain drop_database webmail
if [ -d $WEB_PATH/webmail ]; then if [ -d $WEB_PATH/webmail ]; then
rm -rf $WEB_PATH/webmail rm -rf $WEB_PATH/webmail
fi fi

View File

@ -37,15 +37,25 @@ WIKI_CODE=
WIKI_ONION_PORT=8089 WIKI_ONION_PORT=8089
function upgrade_wiki { function upgrade_wiki {
echo '' echo -n ''
} }
function backup_local_wiki { function backup_local_wiki {
echo '' source_directory=/var/lib/dokuwiki
if [ -d $source_directory ]; then
dest_directory=wiki
echo $"Backing up $source_directory to $dest_directory"
function_check backup_directory_to_usb
backup_directory_to_usb $source_directory $dest_directory
backup_directory_to_usb /etc/dokuwiki wiki2
echo $"Backup to $dest_directory complete"
fi
} }
function backup_remote_wiki { function backup_remote_wiki {
echo '' echo -n ''
} }
function remove_wiki { function remove_wiki {

View File

@ -104,11 +104,20 @@ function upgrade_xmpp {
} }
function backup_local_xmpp { function backup_local_xmpp {
echo '' source_directory=/var/lib/prosody xmpp
if [ -d $source_directory ]; then
dest_directory=xmpp
echo $"Backing up $source_directory to $dest_directory"
function_check backup_directory_to_usb
backup_directory_to_usb $source_directory $dest_directory
echo $"Backup to $dest_directory complete"
fi
} }
function backup_remote_xmpp { function backup_remote_xmpp {
echo '' echo -n ''
} }
function configure_firewall_for_xmpp { function configure_firewall_for_xmpp {