mirror of
https://github.com/YunoHost-Apps/monitorix_ynh.git
synced 2024-09-03 19:46:06 +02:00
Rework doc, stop/start service on backup
This commit is contained in:
parent
5d186194c8
commit
b3c0f4a45a
3 changed files with 19 additions and 37 deletions
|
@ -1,34 +1,3 @@
|
|||
### Upgrade
|
||||
|
||||
By default, a backup is performed before upgrading. To avoid this, you have the following options:
|
||||
- Pass the `NO_BACKUP_UPGRADE` env variable with `1` at each upgrade. For example `NO_BACKUP_UPGRADE=1 yunohost app upgrade monitorix`.
|
||||
- Set `disable_backup_before_upgrade` to `1`. You can set it with this command:
|
||||
|
||||
`yunohost app setting monitorix disable_backup_before_upgrade -v 1`
|
||||
|
||||
After that, the settings will be applied for **all** the next updates.
|
||||
|
||||
From command line:
|
||||
|
||||
`yunohost app upgrade monitorix`
|
||||
|
||||
### Backup
|
||||
|
||||
This application now uses the core-only feature of the backup. To keep the integrity of the data and to have a better guarantee of the restoration it is recommended to proceed as follows:
|
||||
|
||||
- Stop Monitorix service with this command:
|
||||
|
||||
`systemctl stop monitorix.service`
|
||||
|
||||
- Launch Monitorix backup with this command:
|
||||
|
||||
`yunohost backup create --app monitorix`
|
||||
|
||||
- Backup your data with your specific strategy (could be with rsync, borg backup or just cp). The data is generally stored in `/var/lib/monitorix`.
|
||||
- Restart Monitorix service with theses command:
|
||||
|
||||
`systemctl start monitorix.service`
|
||||
|
||||
### Remove
|
||||
|
||||
Due of the backup core only feature the data directory in `/var/lib/monitorix` **is not removed**. It must be manually deleted to purge user data from the app.
|
||||
|
@ -45,7 +14,7 @@ You will have a full complete documentation for monitorix config here : https://
|
|||
|
||||
By example you can extends the basic config by this :
|
||||
|
||||
```
|
||||
```xml
|
||||
priority = 5
|
||||
|
||||
<graph_enable>
|
||||
|
@ -238,7 +207,8 @@ priority = 5
|
|||
|
||||
```
|
||||
|
||||
In this config we have :
|
||||
In this config :
|
||||
|
||||
- We set the process priority to 5 (which mean that it will be lower priority than the other process).
|
||||
- We get the lmsensor sensor data.
|
||||
- We get some sensors data not accessible with lmsensor (with gensens)
|
|
@ -1 +1,3 @@
|
|||
Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services and system resources as possible. It has been created to be used under production Linux/UNIX servers, but due to its simplicity and small size can be used on embedded devices as well.
|
||||
Monitorix is a free, open source, lightweight system monitoring tool designed to monitor as many services and system resources as possible.
|
||||
|
||||
It has been created to be used under production Linux/UNIX servers, but due to its simplicity and small size can be used on embedded devices as well.
|
||||
|
|
|
@ -10,9 +10,12 @@
|
|||
source ../settings/scripts/_common.sh
|
||||
source /usr/share/yunohost/helpers
|
||||
|
||||
if [[ ! "$(systemctl status $app.service)" =~ "Active: inactive (dead)" ]]; then
|
||||
ynh_print_warn --message="It's hightly recommended to make your backup when the service is stopped. Please stop $app service and with this command before to run the backup 'systemctl stop $app.service'"
|
||||
fi
|
||||
#=================================================
|
||||
# STOP SYSTEMD SERVICE
|
||||
#=================================================
|
||||
ynh_script_progression --message="Stopping a systemd service..." --weight=1
|
||||
|
||||
ynh_systemd_action --service_name=$app --action="stop" --log_path="/var/log/$app/$app.log"
|
||||
|
||||
#=================================================
|
||||
# DECLARE DATA AND CONF FILES TO BACKUP
|
||||
|
@ -52,6 +55,13 @@ ynh_print_info --message="Backing up the MySQL database..."
|
|||
|
||||
ynh_mysql_dump_db --database="$db_name" > db.sql
|
||||
|
||||
#=================================================
|
||||
# RESTART APP
|
||||
#=================================================
|
||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||
|
||||
_ynh_systemd_restart_monitorix
|
||||
|
||||
#=================================================
|
||||
# END OF SCRIPT
|
||||
#=================================================
|
||||
|
|
Loading…
Reference in a new issue