1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/borgserver_ynh.git synced 2024-09-03 20:36:20 +02:00
borgserver_ynh/conf/17-data_home

22 lines
460 B
Text
Raw Normal View History

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