|
|
@@ -43,14 +43,25 @@ systemctl status couchdb
|
|
|
# RESTORE THE APP MAIN DIR
|
|
|
ynh_script_progression --message="Restoring the app main directory..." --weight=10
|
|
|
ynh_restore_file --origin_path="$install_dir"
|
|
|
-# chmod -R 644 $install_dir
|
|
|
-# chown -R root:$app $install_dir
|
|
|
|
|
|
# RESTORE THE DATA DIRECTORY
|
|
|
ynh_script_progression --message="Restoring the data directory..." --weight=1
|
|
|
ynh_restore_file --origin_path="$data_dir" --not_mandatory
|
|
|
mkdir -p $data_dir
|
|
|
|
|
|
+# restore logfiles
|
|
|
+# independent of the question whether one wants the logfiles in a backup (as you can
|
|
|
+# see I decided I wanted them for the time being) it is important to create the log
|
|
|
+# directory and file so that the systemd.service can redirect STDOUT to the file.
|
|
|
+# If the logfile(or maybe just -directory?) is missing the service will not start
|
|
|
+# on a fresh install, because directory and/or file do not exist.
|
|
|
+ynh_script_progression --message="Restoring log directory and logfiles..." --weight=1
|
|
|
+ynh_restore_file --origin_path="/var/log/$app" --not_mandatory
|
|
|
+mkdir -p -m755 "/var/log/$app"
|
|
|
+touch "/var/log/$app/$app"
|
|
|
+# logfile contains possibly the secret setup URL
|
|
|
+chmod 640 "/var/log/$app/$app"
|
|
|
+
|
|
|
# RESTORE FAIL2BAN CONFIGURATION
|
|
|
ynh_script_progression --message="Restoring the Fail2Ban configuration..." --weight=2
|
|
|
ynh_restore_file --origin_path="/etc/fail2ban/jail.d/$app.conf"
|