yunohost/data/hooks/backup/17-data_home

17 lines
393 B
Bash
Executable file

#!/bin/bash
# Exit hook on subcommand error or unset variable
set -eu
# Source YNH helpers
source /usr/share/yunohost/helpers.d/filesystem
# Backup destination
backup_dir="${1}/data/home"
# Backup user home
for f in $(find /home/* -type d -prune | awk -F/ '{print $NF}'); do
if [[ ! "$f" =~ ^yunohost|lost\+found ]]; then
ynh_backup "/home/$f" "${backup_dir}/$f" 1
fi
done