I am currently reworking my whole backup strategy (aka starting to do backups) and i’ll probably use Borg. However i could not find this information anywhere : is there a simple way to exclude a specific directory and all its content from Borg backups (in particular /home/yunohost.multimedia/share/)? It is super heavy and there is nothing too precious in it so i dont want to clog my backup HD with it.
Thanks !
Salut à toustes
Je retravaille en profondeur mon workflow de sauvegarde de données (autrement dit je commence à me dire que faire des backups c’est pas mal) et je me dis que je vais utiliser Borg. Toutefois, impossible de trouver l’info suivante : y a t-il un moyen simple d’exclure un dossier en particulier (en l’occurance /home/yunohost.multimedia/share/) des sauvegardes Borg ? Il est extrêmement lourd et ne renferme rien de particulièrement important.
Well i wish it was that simple but from what i’ve read in the documentation and what other threads on the forum say .nobackup files only work for /home/. directories so anythkng deeper than /home/yunohost.multimedia/ would not be affected
#!/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" ] || [ -e "/home/yunohost.multimedia/.nobackup" ]; then
exit 0
fi
# Backup multimedia directory
for user in $(ls /home/yunohost.multimedia) ; do
if [ ! -e "/home/yunohost.multimedia/$user/.nobackup" ]; then
ynh_backup --src_path="/home/yunohost.multimedia/$user" --dest_path="${backup_dir}/$user" --is_big --not_mandatory
fi
done