Restoring wiki from backup

This commit is contained in:
Bob Mottram 2016-10-30 14:13:11 +00:00
parent 6b7049a5d3
commit 22da3b7a00
1 changed files with 16 additions and 9 deletions

View File

@ -93,9 +93,12 @@ function restore_local_dokuwiki {
DOKUWIKI_DOMAIN_NAME=$(get_completion_param "dokuwiki domain")
temp_restore_dir=/root/tempdokuwiki
function_check restore_directory_from_usb
restore_directory_from_usb $temp_restore_dir wiki
restore_directory_from_usb $temp_restore_dir dokuwiki
cp -r $temp_restore_dir/var/lib/dokuwiki/* /var/lib/dokuwiki/
if [ -d ${USB_MOUNT}/backup/wiki ]; then
restore_directory_from_usb ${temp_restore_dir} wiki
else
restore_directory_from_usb ${temp_restore_dir} dokuwiki
fi
cp -r ${temp_restore_dir}/var/lib/dokuwiki/* /var/lib/dokuwiki/
if [ ! "$?" = "0" ]; then
function_check restore_directory_from_usb
set_user_permissions
@ -103,7 +106,11 @@ function restore_local_dokuwiki {
backup_unmount_drive
exit 868
fi
restore_directory_from_usb ${temp_restore_dir}2 dokuwiki2
if [ -d ${USB_MOUNT}/backup/wiki2 ]; then
restore_directory_from_usb ${temp_restore_dir}2 wiki2
else
restore_directory_from_usb ${temp_restore_dir}2 dokuwiki2
fi
cp -r ${temp_restore_dir}2/etc/dokuwiki/* /etc/dokuwiki/
if [ ! "$?" = "0" ]; then
function_check set_user_permissions
@ -112,10 +119,10 @@ function restore_local_dokuwiki {
backup_unmount_drive
exit 869
fi
rm -rf $temp_restore_dir
rm -rf ${temp_restore_dir}
rm -rf ${temp_restore_dir}2
rm -rf /var/lib/dokuwiki/data/cache/*
rm -rf /var/lib/dokuwiki/data/meta/*
#rm -rf /var/lib/dokuwiki/data/cache/*
#rm -rf /var/lib/dokuwiki/data/meta/*
chmod -R 755 /var/lib/dokuwiki/data
chown -R www-data:www-data /var/lib/dokuwiki/data
chown -R www-data:www-data /var/lib/dokuwiki/*
@ -157,8 +164,8 @@ function restore_remote_dokuwiki {
fi
rm -rf /root/tempdokuwiki
rm -rf /root/tempdokuwiki2
rm -rf /var/lib/dokuwiki/data/cache/*
rm -rf /var/lib/dokuwiki/data/meta/*
#rm -rf /var/lib/dokuwiki/data/cache/*
#rm -rf /var/lib/dokuwiki/data/meta/*
chmod -R 755 /var/lib/dokuwiki/data
chown -R www-data:www-data /var/lib/dokuwiki/data
chown -R www-data:www-data /var/lib/dokuwiki/*