mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Add backup for multimedia files
This commit is contained in:
parent
db6a520065
commit
88063dc7db
2 changed files with 26 additions and 0 deletions
17
data/hooks/backup/18-data_multimedia
Normal file
17
data/hooks/backup/18-data_multimedia
Normal 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
|
9
data/hooks/restore/18-data_multimedia
Normal file
9
data/hooks/restore/18-data_multimedia
Normal 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
|
Loading…
Add table
Reference in a new issue