mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Add backup/restore hooks for manually modified files
This commit is contained in:
parent
23ceedf5d1
commit
d750b77e46
2 changed files with 27 additions and 0 deletions
16
data/hooks/backup/50-conf_manually_modified_files
Normal file
16
data/hooks/backup/50-conf_manually_modified_files
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source /usr/share/yunohost/helpers
|
||||||
|
ynh_abort_if_errors
|
||||||
|
YNH_CWD="${YNH_BACKUP_DIR%/}/conf/manually_modified_files"
|
||||||
|
mkdir -p "$YNH_CWD"
|
||||||
|
cd "$YNH_CWD"
|
||||||
|
|
||||||
|
yunohost tools shell -c "from yunohost.regenconf import manually_modified_files; print('\n'.join(manually_modified_files()))" > ./manually_modified_files_list
|
||||||
|
|
||||||
|
ynh_backup --src_path="./manually_modified_files_list"
|
||||||
|
|
||||||
|
for file in $(cat ./manually_modified_files_list)
|
||||||
|
do
|
||||||
|
ynh_backup --src_path="$file"
|
||||||
|
done
|
11
data/hooks/restore/50-conf_manually_modified_files
Normal file
11
data/hooks/restore/50-conf_manually_modified_files
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source /usr/share/yunohost/helpers
|
||||||
|
ynh_abort_if_errors
|
||||||
|
YNH_CWD="${YNH_BACKUP_DIR%/}/conf/manually_modified_files"
|
||||||
|
cd "$YNH_CWD"
|
||||||
|
|
||||||
|
for file in $(cat ./manually_modified_files_list)
|
||||||
|
do
|
||||||
|
ynh_restore_file --origin_path="$file" --not_mandatory
|
||||||
|
done
|
Loading…
Add table
Reference in a new issue