parent
f902b04d46
commit
37b0fd0e12
|
@ -100,10 +100,6 @@ function update_domains {
|
||||||
if grep -q "Blog domain" $COMPLETION_FILE; then
|
if grep -q "Blog domain" $COMPLETION_FILE; then
|
||||||
FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}')
|
FULLBLOG_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Blog domain" | awk -F ':' '{print $2}')
|
||||||
fi
|
fi
|
||||||
OWNCLOUD_DOMAIN_NAME='owncloud'
|
|
||||||
if grep -q "Owncloud domain" $COMPLETION_FILE; then
|
|
||||||
OWNCLOUD_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Owncloud domain" | awk -F ':' '{print $2}')
|
|
||||||
fi
|
|
||||||
MEDIAGOBLIN_DOMAIN_NAME='mediagoblin'
|
MEDIAGOBLIN_DOMAIN_NAME='mediagoblin'
|
||||||
if grep -q "Mediagoblin domain" $COMPLETION_FILE; then
|
if grep -q "Mediagoblin domain" $COMPLETION_FILE; then
|
||||||
MEDIAGOBLIN_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Mediagoblin domain" | awk -F ':' '{print $2}')
|
MEDIAGOBLIN_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Mediagoblin domain" | awk -F ':' '{print $2}')
|
||||||
|
@ -299,6 +295,25 @@ function backup_users {
|
||||||
backup_directory_to_usb /home/$USERNAME/.fin fin/$USERNAME
|
backup_directory_to_usb /home/$USERNAME/.fin fin/$USERNAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Backup syncthing
|
||||||
|
if [ -d /home/$USERNAME/Sync ]; then
|
||||||
|
echo $"Backing up syncthing files for $USERNAME"
|
||||||
|
backup_directory_to_usb /home/$USERNAME/Sync syncthing/$USERNAME
|
||||||
|
# ensure that device IDs will be backed up as part of user config settings
|
||||||
|
if [ ! -d /home/$USERNAME/.config/syncthing ]; then
|
||||||
|
mkdir -p /home/$USERNAME/.config/syncthing
|
||||||
|
chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
||||||
|
fi
|
||||||
|
if [ -f /home/$USERNAME/.syncthing-server-id ]; then
|
||||||
|
cp /home/$USERNAME/.syncthing-server-id /home/$USERNAME/.config/syncthing
|
||||||
|
chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
||||||
|
fi
|
||||||
|
if [ -f /home/$USERNAME/.syncthingids ]; then
|
||||||
|
cp /home/$USERNAME/.syncthingids /home/$USERNAME/.config/syncthing
|
||||||
|
chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Backup user configs
|
# Backup user configs
|
||||||
if [ -d /home/$USERNAME/.config ]; then
|
if [ -d /home/$USERNAME/.config ]; then
|
||||||
echo $"Backing up config files for $USERNAME"
|
echo $"Backing up config files for $USERNAME"
|
||||||
|
@ -374,9 +389,8 @@ function backup_directories {
|
||||||
"none, none, /var/lib/tox-bootstrapd, tox"
|
"none, none, /var/lib/tox-bootstrapd, tox"
|
||||||
"/var/www/${MICROBLOG_DOMAIN_NAME}, gnusocial, /root/tempgnusocialdata, gnusocialdata"
|
"/var/www/${MICROBLOG_DOMAIN_NAME}, gnusocial, /root/tempgnusocialdata, gnusocialdata"
|
||||||
"none, none, /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs, gnusocial"
|
"none, none, /var/www/${MICROBLOG_DOMAIN_NAME}/htdocs, gnusocial"
|
||||||
"/var/www/owncloud, owncloud, /root/tempownclouddata, ownclouddata"
|
"none, none, /var/lib/syncthing/SyncShared, syncthingshared"
|
||||||
"none, none, /var/www/owncloud/data, owncloudfiles"
|
"none, none, /root/.config/syncthing, syncthingconfig"
|
||||||
"none, none, /var/www/owncloud/config, owncloudconfig"
|
|
||||||
"/var/www/${HUBZILLA_DOMAIN_NAME}, hubzilla, /root/temphubzilladata, hubzilladata"
|
"/var/www/${HUBZILLA_DOMAIN_NAME}, hubzilla, /root/temphubzilladata, hubzilladata"
|
||||||
"none, none, /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs, hubzilla"
|
"none, none, /var/www/${HUBZILLA_DOMAIN_NAME}/htdocs, hubzilla"
|
||||||
"none, none, /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs, blog"
|
"none, none, /var/www/${FULLBLOG_DOMAIN_NAME}/htdocs, blog"
|
||||||
|
@ -396,9 +410,6 @@ function backup_directories {
|
||||||
if [[ "$database_name" == *"gnusocial"* ]]; then
|
if [[ "$database_name" == *"gnusocial"* ]]; then
|
||||||
suspend_site ${MICROBLOG_DOMAIN_NAME}
|
suspend_site ${MICROBLOG_DOMAIN_NAME}
|
||||||
fi
|
fi
|
||||||
if [[ "$database_name" == *"owncloud"* ]]; then
|
|
||||||
suspend_site ${OWNCLOUD_DOMAIN_NAME}
|
|
||||||
fi
|
|
||||||
if [[ "$database_name" == *"gogs"* ]]; then
|
if [[ "$database_name" == *"gogs"* ]]; then
|
||||||
suspend_site ${GIT_DOMAIN_NAME}
|
suspend_site ${GIT_DOMAIN_NAME}
|
||||||
fi
|
fi
|
||||||
|
@ -535,9 +546,9 @@ function valid_backup_destination {
|
||||||
"$destination_dir" == "ssl" || \
|
"$destination_dir" == "ssl" || \
|
||||||
"$destination_dir" == "ttrss" || \
|
"$destination_dir" == "ttrss" || \
|
||||||
"$destination_dir" == "blog" || \
|
"$destination_dir" == "blog" || \
|
||||||
"$destination_dir" == "owncloudfiles" || \
|
"$destination_dir" == "syncthingconfig" || \
|
||||||
"$destination_dir" == "owncloudconfig" || \
|
"$destination_dir" == "syncthingshared" || \
|
||||||
"$destination_dir" == "ownclouddata" || \
|
"$destination_dir" == "syncthing" || \
|
||||||
"$destination_dir" == "mediagoblin" || \
|
"$destination_dir" == "mediagoblin" || \
|
||||||
"$destination_dir" == "mailinglist" ]]; then
|
"$destination_dir" == "mailinglist" ]]; then
|
||||||
is_valid="no"
|
is_valid="no"
|
||||||
|
|
|
@ -202,6 +202,25 @@ function backup_users {
|
||||||
backup_directory_to_friend /home/$USERNAME/.ssh ssh/$USERNAME
|
backup_directory_to_friend /home/$USERNAME/.ssh ssh/$USERNAME
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# syncthing files
|
||||||
|
if [ -d /home/$USERNAME/Sync ]; then
|
||||||
|
echo $"Backing up syncthing files for $USERNAME"
|
||||||
|
backup_directory_to_friend /home/$USERNAME/Sync syncthing/$USERNAME
|
||||||
|
# ensure that device IDs will be backed up as part of user config settings
|
||||||
|
if [ ! -d /home/$USERNAME/.config/syncthing ]; then
|
||||||
|
mkdir -p /home/$USERNAME/.config/syncthing
|
||||||
|
chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
||||||
|
fi
|
||||||
|
if [ -f /home/$USERNAME/.syncthing-server-id ]; then
|
||||||
|
cp /home/$USERNAME/.syncthing-server-id /home/$USERNAME/.config/syncthing
|
||||||
|
chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
||||||
|
fi
|
||||||
|
if [ -f /home/$USERNAME/.syncthingids ]; then
|
||||||
|
cp /home/$USERNAME/.syncthingids /home/$USERNAME/.config/syncthing
|
||||||
|
chown -R $USERNAME:$USERNAME /home/$USERNAME/.config
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# config files
|
# config files
|
||||||
if [ -d /home/$USERNAME/.config ]; then
|
if [ -d /home/$USERNAME/.config ]; then
|
||||||
echo $"Backing up config files for $USERNAME"
|
echo $"Backing up config files for $USERNAME"
|
||||||
|
@ -326,18 +345,14 @@ function backup_hubzilla {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function backup_owncloud {
|
function backup_syncthing {
|
||||||
if [ -d /etc/owncloud ]; then
|
if [ -d /root/.config/syncthing ]; then
|
||||||
OWNCLOUD_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Owncloud domain" | awk -F ':' '{print $2}')
|
echo $"Backing up syncthing configuration"
|
||||||
suspend_site ${OWNCLOUD_DOMAIN_NAME}
|
backup_directory_to_friend /root/.config/syncthing syncthingconfig
|
||||||
backup_database_to_friend owncloud
|
|
||||||
backup_directory_to_friend /root/tempownclouddata ownclouddata
|
|
||||||
echo $"Backing up Owncloud data"
|
|
||||||
if [ -d /var/www/owncloud/data ]; then
|
|
||||||
backup_directory_to_friend /var/www/owncloud/data owncloudfiles
|
|
||||||
fi
|
fi
|
||||||
backup_directory_to_friend /var/www/owncloud/config owncloudconfig
|
if [ -d /var/lib/syncthing/SyncShared ]; then
|
||||||
restart_site
|
echo $"Backing up syncthing shared files"
|
||||||
|
backup_directory_to_friend /var/lib/syncthing/SyncShared syncthingshared
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -566,9 +581,9 @@ function valid_backup_destination {
|
||||||
"$destination_dir" == "tox" || \
|
"$destination_dir" == "tox" || \
|
||||||
"$destination_dir" == "ssl" || \
|
"$destination_dir" == "ssl" || \
|
||||||
"$destination_dir" == "blog" || \
|
"$destination_dir" == "blog" || \
|
||||||
"$destination_dir" == "owncloudfiles" || \
|
"$destination_dir" == "syncthing" || \
|
||||||
"$destination_dir" == "owncloudconfig" || \
|
"$destination_dir" == "syncthingconfig" || \
|
||||||
"$destination_dir" == "ownclouddata" || \
|
"$destination_dir" == "syncthingshared" || \
|
||||||
"$destination_dir" == "mailinglist" ]]; then
|
"$destination_dir" == "mailinglist" ]]; then
|
||||||
is_valid="no"
|
is_valid="no"
|
||||||
fi
|
fi
|
||||||
|
@ -612,7 +627,7 @@ if [[ $TEST_MODE == "no" ]]; then
|
||||||
backup_gnusocial
|
backup_gnusocial
|
||||||
backup_rss_reader
|
backup_rss_reader
|
||||||
backup_hubzilla
|
backup_hubzilla
|
||||||
backup_owncloud
|
backup_syncthing
|
||||||
backup_mediagoblin
|
backup_mediagoblin
|
||||||
backup_gogs
|
backup_gogs
|
||||||
backup_wiki
|
backup_wiki
|
||||||
|
|
|
@ -57,7 +57,6 @@ DATABASE_PASSWORD=$(cat /root/dbpass)
|
||||||
|
|
||||||
MICROBLOG_DOMAIN_NAME=
|
MICROBLOG_DOMAIN_NAME=
|
||||||
HUBZILLA_DOMAIN_NAME=
|
HUBZILLA_DOMAIN_NAME=
|
||||||
OWNCLOUD_DOMAIN_NAME=
|
|
||||||
MEDIAGOBLIN_DOMAIN_NAME=
|
MEDIAGOBLIN_DOMAIN_NAME=
|
||||||
GIT_DOMAIN_NAME=
|
GIT_DOMAIN_NAME=
|
||||||
WIKI_DOMAIN_NAME=
|
WIKI_DOMAIN_NAME=
|
||||||
|
@ -247,9 +246,6 @@ function update_domains {
|
||||||
if grep -q "Hubzilla domain" $COMPLETION_FILE; then
|
if grep -q "Hubzilla domain" $COMPLETION_FILE; then
|
||||||
HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
|
HUBZILLA_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Hubzilla domain" | awk -F ':' '{print $2}')
|
||||||
fi
|
fi
|
||||||
if grep -q "Owncloud domain" $COMPLETION_FILE; then
|
|
||||||
OWNCLOUD_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Owncloud domain" | awk -F ':' '{print $2}')
|
|
||||||
fi
|
|
||||||
if grep -q "Mediagoblin domain" $COMPLETION_FILE; then
|
if grep -q "Mediagoblin domain" $COMPLETION_FILE; then
|
||||||
MEDIAGOBLIN_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Mediagoblin domain" | awk -F ':' '{print $2}')
|
MEDIAGOBLIN_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Mediagoblin domain" | awk -F ':' '{print $2}')
|
||||||
fi
|
fi
|
||||||
|
@ -827,46 +823,80 @@ function restore_hubzilla {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore_owncloud {
|
function restore_syncthing {
|
||||||
if [[ $RESTORE_APP != 'all' ]]; then
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
if [[ $RESTORE_APP != 'owncloud' ]]; then
|
if [[ $RESTORE_APP != 'syncthing' ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
OWNCLOUD_PATH=/var/www/owncloud
|
|
||||||
if [ $OWNCLOUD_DOMAIN_NAME ]; then
|
|
||||||
restore_database owncloud $OWNCLOUD_DOMAIN_NAME
|
|
||||||
|
|
||||||
if [ -d $USB_MOUNT/backup/owncloudfiles ]; then
|
if [ -f /etc/systemd/system/syncthing.service ]; then
|
||||||
restore_directory_from_usb /root/tempowncloudfiles owncloudfiles
|
systemctl stop syncthing
|
||||||
cp -r /root/tempowncloudfiles/* /
|
systemctl stop cron
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -d $USB_MOUNT/backup/syncthingconfig ]; then
|
||||||
|
echo $"Restoring syncthing configuration"
|
||||||
|
restore_directory_from_usb /root/tempsyncthingconfig syncthingconfig
|
||||||
|
cp -r /root/tempsyncthingconfig/* /
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
unmount_drive
|
unmount_drive
|
||||||
exit 982
|
systemctl start syncthing
|
||||||
|
systemctl start cron
|
||||||
|
exit 6833
|
||||||
fi
|
fi
|
||||||
rm -rf /root/tempowncloudfiles
|
rm -rf /root/tempsyncthingconfig
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d $USB_MOUNT/backup/owncloudconfig ]; then
|
if [ -d $USB_MOUNT/backup/syncthingshared ]; then
|
||||||
restore_directory_from_usb /root/tempowncloudconfig owncloudconfig
|
echo $"Restoring syncthing shared files"
|
||||||
cp -r /root/tempowncloudconfig/* /
|
restore_directory_from_usb /root/tempsyncthingshared syncthingshared
|
||||||
|
cp -r /root/tempsyncthingshared/* /
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
unmount_drive
|
unmount_drive
|
||||||
exit 7825
|
systemctl start syncthing
|
||||||
|
systemctl start cron
|
||||||
|
exit 37904
|
||||||
fi
|
fi
|
||||||
rm -rf /root/tempowncloudconfig
|
rm -rf /root/tempsyncthingshared
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# re-index the files
|
if [ -d $USB_MOUNT/backup/syncthing ]; then
|
||||||
chown -R www-data:www-data $OWNCLOUD_PATH
|
for d in $USB_MOUNT/backup/syncthing/*/ ; do
|
||||||
chown root:root $OWNCLOUD_PATH/config/config.php
|
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||||
for d in /home/*/ ; do
|
|
||||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
|
||||||
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
|
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
|
||||||
$OWNCLOUD_PATH/occ files:scan $USERNAME
|
if [ ! -d /home/$USERNAME ]; then
|
||||||
|
${PROJECT_NAME}-adduser $USERNAME
|
||||||
|
fi
|
||||||
|
echo $"Restoring syncthing files for $USERNAME"
|
||||||
|
restore_directory_from_usb /root/tempsyncthing syncthing/$USERNAME
|
||||||
|
cp -r /root/tempsyncthing/home/$USERNAME/Sync /home/$USERNAME/
|
||||||
|
if [ ! "$?" = "0" ]; then
|
||||||
|
rm -rf /root/tempsyncthing
|
||||||
|
unmount_drive
|
||||||
|
systemctl start syncthing
|
||||||
|
systemctl start cron
|
||||||
|
exit 68438
|
||||||
|
fi
|
||||||
|
rm -rf /root/tempsyncthing
|
||||||
|
|
||||||
|
# restore device IDs from config settings
|
||||||
|
if [ -f /home/$USERNAME/.config/syncthing/.syncthing-server-id ]; then
|
||||||
|
cp /home/$USERNAME/.config/syncthing/.syncthing-server-id /home/$USERNAME/.syncthing-server-id
|
||||||
|
chown $USERNAME:$USERNAME /home/$USERNAME/.syncthing-server-id
|
||||||
|
fi
|
||||||
|
if [ -f /home/$USERNAME/.config/syncthing/.syncthingids ]; then
|
||||||
|
cp /home/$USERNAME/.config/syncthing/.syncthingids /home/$USERNAME/.syncthingids
|
||||||
|
chown $USERNAME:$USERNAME /home/$USERNAME/.syncthingids
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/systemd/system/syncthing.service ]; then
|
||||||
|
systemctl start syncthing
|
||||||
|
systemctl start cron
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore_mediagoblin {
|
function restore_mediagoblin {
|
||||||
|
@ -1174,7 +1204,7 @@ restore_xmpp
|
||||||
restore_gnu_social
|
restore_gnu_social
|
||||||
restore_hubzilla
|
restore_hubzilla
|
||||||
restore_rss_reader
|
restore_rss_reader
|
||||||
restore_owncloud
|
restore_syncthing
|
||||||
restore_mediagoblin
|
restore_mediagoblin
|
||||||
restore_gogs
|
restore_gogs
|
||||||
restore_wiki
|
restore_wiki
|
||||||
|
|
|
@ -693,48 +693,80 @@ function restore_hubzilla {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore_owncloud {
|
function restore_syncthing {
|
||||||
if [[ $RESTORE_APP != 'all' ]]; then
|
if [[ $RESTORE_APP != 'all' ]]; then
|
||||||
if [[ $RESTORE_APP != 'owncloud' ]]; then
|
if [[ $RESTORE_APP != 'syncthing' ]]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
OWNCLOUD_PATH=/var/www/owncloud
|
|
||||||
if grep -q "Owncloud domain" $COMPLETION_FILE; then
|
|
||||||
OWNCLOUD_DOMAIN_NAME=$(cat $COMPLETION_FILE | grep "Owncloud domain" | awk -F ':' '{print $2}')
|
|
||||||
restore_database_from_friend owncloud $OWNCLOUD_DOMAIN_NAME
|
|
||||||
|
|
||||||
if [ -d $SERVER_DIRECTORY/backup/owncloudfiles ]; then
|
if [ -f /etc/systemd/system/syncthing.service ]; then
|
||||||
echo $"Restoring Owncloud installation"
|
systemctl stop syncthing
|
||||||
restore_directory_from_friend /root/tempowncloudfiles owncloudfiles
|
systemctl stop cron
|
||||||
cp -r /root/tempowncloudfiles/* /
|
fi
|
||||||
|
|
||||||
|
if [ -d $SERVER_DIRECTORY/backup/syncthingconfig ]; then
|
||||||
|
echo $"Restoring syncthing configuration"
|
||||||
|
restore_directory_from_friend /root/tempsyncthingconfig syncthingconfig
|
||||||
|
cp -r /root/tempsyncthingconfig/* /
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
exit 1458
|
unmount_drive
|
||||||
|
systemctl start syncthing
|
||||||
|
systemctl start cron
|
||||||
|
exit 6833
|
||||||
fi
|
fi
|
||||||
rm -rf /root/tempowncloudfiles
|
rm -rf /root/tempsyncthingconfig
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -d $SERVER_DIRECTORY/backup/owncloudconfig ]; then
|
if [ -d $SERVER_DIRECTORY/backup/syncthingshared ]; then
|
||||||
echo $"Restoring Owncloud installation"
|
echo $"Restoring syncthing shared files"
|
||||||
restore_directory_from_friend /root/tempowncloudconfig owncloudconfig
|
restore_directory_from_friend /root/tempsyncthingshared syncthingshared
|
||||||
cp -r /root/tempowncloudconfig/* /
|
cp -r /root/tempsyncthingshared/* /
|
||||||
if [ ! "$?" = "0" ]; then
|
if [ ! "$?" = "0" ]; then
|
||||||
exit 2571
|
unmount_drive
|
||||||
|
systemctl start syncthing
|
||||||
|
systemctl start cron
|
||||||
|
exit 37904
|
||||||
fi
|
fi
|
||||||
rm -rf /root/tempowncloudconfig
|
rm -rf /root/tempsyncthingshared
|
||||||
fi
|
fi
|
||||||
|
|
||||||
chown -R www-data:www-data $OWNCLOUD_PATH
|
if [ -d $SERVER_DIRECTORY/backup/syncthing ]; then
|
||||||
chown root:root $OWNCLOUD_PATH/config/config.php
|
for d in $SERVER_DIRECTORY/backup/syncthing/*/ ; do
|
||||||
|
USERNAME=$(echo "$d" | awk -F '/' '{print $6}')
|
||||||
# re-index files
|
|
||||||
for d in /home/*/ ; do
|
|
||||||
USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
|
|
||||||
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
|
if [[ $USERNAME != "git" && $USERNAME != "mirrors" && $USERNAME != "sync" ]]; then
|
||||||
$OWNCLOUD_PATH/occ files:scan $USERNAME
|
if [ ! -d /home/$USERNAME ]; then
|
||||||
|
${PROJECT_NAME}-adduser $USERNAME
|
||||||
|
fi
|
||||||
|
echo $"Restoring syncthing files for $USERNAME"
|
||||||
|
restore_directory_from_friend /root/tempsyncthing syncthing/$USERNAME
|
||||||
|
cp -r /root/tempsyncthing/home/$USERNAME/Sync /home/$USERNAME/
|
||||||
|
if [ ! "$?" = "0" ]; then
|
||||||
|
rm -rf /root/tempsyncthing
|
||||||
|
unmount_drive
|
||||||
|
systemctl start syncthing
|
||||||
|
systemctl start cron
|
||||||
|
exit 68438
|
||||||
|
fi
|
||||||
|
rm -rf /root/tempsyncthing
|
||||||
|
|
||||||
|
# restore device IDs from config settings
|
||||||
|
if [ -f /home/$USERNAME/.config/syncthing/.syncthing-server-id ]; then
|
||||||
|
cp /home/$USERNAME/.config/syncthing/.syncthing-server-id /home/$USERNAME/.syncthing-server-id
|
||||||
|
chown $USERNAME:$USERNAME /home/$USERNAME/.syncthing-server-id
|
||||||
|
fi
|
||||||
|
if [ -f /home/$USERNAME/.config/syncthing/.syncthingids ]; then
|
||||||
|
cp /home/$USERNAME/.config/syncthing/.syncthingids /home/$USERNAME/.syncthingids
|
||||||
|
chown $USERNAME:$USERNAME /home/$USERNAME/.syncthingids
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/systemd/system/syncthing.service ]; then
|
||||||
|
systemctl start syncthing
|
||||||
|
systemctl start cron
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function restore_mediagoblin {
|
function restore_mediagoblin {
|
||||||
|
@ -1014,7 +1046,7 @@ restore_xmpp
|
||||||
restore_gnu_social
|
restore_gnu_social
|
||||||
restore_hubzilla
|
restore_hubzilla
|
||||||
restore_rss_reader
|
restore_rss_reader
|
||||||
restore_owncloud
|
restore_syncthing
|
||||||
restore_mediagoblin
|
restore_mediagoblin
|
||||||
restore_gogs
|
restore_gogs
|
||||||
restore_wiki
|
restore_wiki
|
||||||
|
|
Loading…
Reference in New Issue