[fix] Update data_home/mail backup hooks to use ynh_backup helper

This commit is contained in:
Jérôme Lebleu 2016-05-08 00:30:54 +02:00
parent 403b1d71a3
commit f9f8673e76
2 changed files with 2 additions and 7 deletions

View file

@ -1,10 +1,7 @@
backup_dir="$1/data/home"
sudo mkdir -p $backup_dir
. /usr/share/yunohost/helpers . /usr/share/yunohost/helpers
for f in $(find /home/* -type d -prune | awk -F/ '{print $NF}'); do for f in $(find /home/* -type d -prune | awk -F/ '{print $NF}'); do
if [[ ! "$f" =~ ^yunohost|lost\+found ]]; then if [[ ! "$f" =~ ^yunohost|lost\+found ]]; then
ynh_bind_or_cp "/home/$f" "${backup_dir}/$f" 1 ynh_backup "/home/$f" "${1}/data/home/$f" 1
fi fi
done done

View file

@ -1,5 +1,3 @@
backup_dir="$1/data/mail"
. /usr/share/yunohost/helpers . /usr/share/yunohost/helpers
ynh_bind_or_cp /var/mail $backup_dir 1 ynh_backup /var/mail "${1}/data/mail" 1