Backups of some specific directories/files

Hello,

I have several files I’ve created, basically some services (in /etc/systemd/system) calling some scripts under /root/.

Are these repositories in backup list? or can I add them into?

You can add it, by creating a backup hook and a restore hook.

Backup

mkdir /etc/yunohost/hooks.d/backup
touch /etc/yunohost/hooks.d/backup/90-data_WHATYOUWANT

/etc/yunohost/hooks.d/backup/90-data_WHATYOUWANT

#!/bin/bash

# Exit hook on subcommand error or unset variable
set -eu

# Source YNH helpers
source /usr/share/yunohost/helpers

ynh_backup "/root/"

Restore

mkdir /etc/yunohost/hooks.d/restore
touch /etc/yunohost/hooks.d/restore/90-data_WHATYOUWANT

/etc/yunohost/hooks.d/restore/90-data_WHATYOUWANT

#!/bin/bash

# Exit hook on subcommand error or unset variable
set -eu

# Source YNH helpers
source /usr/share/yunohost/helpers

ynh_restore
1 Like

Thanks @ljf, just in case I’m adding here a link to this (now locked) topic I noticed today for creating a backlink to this thread, it may help some people.