[fix] Add backup for multimedia files

This commit is contained in:
ljf 2021-03-03 18:29:32 +01:00 committed by ljf (zamentur)
parent db6a520065
commit 88063dc7db
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,17 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
source /usr/share/yunohost/helpers
# Backup destination
backup_dir="${1}/data/multimedia"
if [ -e "/home/yunohost.multimedia/.nobackup" ]; then
exit 0
fi
# Backup multimedia directory
ynh_backup --src_path="/home/yunohost.multimedia" --dest_path="${backup_dir}" --is_big --not_mandatory

View file

@ -0,0 +1,9 @@
#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
source /usr/share/yunohost/helpers
ynh_restore_file --origin_path="/home/yunohost.multimedia" --not_mandatory