Move remote blog backup to app script

This commit is contained in:
Bob Mottram 2016-07-09 21:32:17 +01:00
parent 1467b02487
commit 84db3b4037
2 changed files with 14 additions and 17 deletions

View File

@ -39,7 +39,7 @@ MY_BLOG_TITLE="My Blog"
MY_BLOG_SUBTITLE="Another ${PROJECT_NAME} Blog"
function reconfigure_blog {
echo -n ''
echo -n ''
}
function upgrade_blog {
@ -121,7 +121,18 @@ function restore_local_blog {
}
function backup_remote_blog {
echo -n ''
if grep -q "Blog domain" $COMPLETION_FILE; then
FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}')
temp_backup_dir=/var/www/${FULLBLOG_DOMAIN_NAME}/htdocs
if [ -d $temp_backup_dir ]; then
echo $"Backing up blog"
backup_directory_to_friend $temp_backup_dir blog
echo $"Backup of blog complete"
else
echo $"Blog domain specified but not found in $temp_backup_dir"
exit 2578
fi
fi
}
function restore_remote_blog {

View File

@ -244,19 +244,6 @@ function backup_tor {
fi
}
function backup_blog {
if grep -q "Blog domain" $COMPLETION_FILE; then
FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}')
if [ -d /var/www/${FULLBLOG_DOMAIN_NAME} ]; then
echo $"Backing up blog"
backup_directory_to_friend /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs blog
else
echo $"Blog domain specified but not found in /var/www/${FULLBLOG_DOMAIN_NAME}"
exit 2578
fi
fi
}
function backup_certs {
if [ -d /etc/ssl ]; then
echo $"Backing up certificates"
@ -480,10 +467,9 @@ if [[ $TEST_MODE == "no" ]]; then
backup_web_server
backup_admin_readme
backup_mariadb
backup_blog
backup_certs
backup_mailing_list
backup_xmpp
backup_ipfs
backup_dlna