Editing v-backup-user and keeping it

I need to edit v-backup-user file to exclude email data from backup. So far so good. But how about updates? Will my edits get overwritten when hestia updates?

Easiest method is to rename it via:

Other option is to use GitHub - jaapmarcus/hestia-hooks: Hooks to set Hestia in Demo mode / disable mode for updating

to make the changes

1 Like

So in case of this file needs to be updated, I must manually overwrite it?
But one thing, hestia is also doing updates as sudo? Wont it also overwrite even I chattr?

No it should not.

But feel free to try it first

Can I add command right after update to edit file like post-command?

No, chattr needs to be done once after you are done editing.

The hook method allows you to update the v-backup-user file after a update has ran…

1 Like

Ok thank you. In fact best way would be an option to select what to include in backup :slight_smile:

For mail accounts you can exclude certain mail accounts (But it also excludes the config then)

I only need to exclude mail datas. So comment out:. (Did not test at latest version)

Backup emails

    cd $HOMEDIR/$user/mail/$domain_idn
    for account in $(ls); do
        exclusion=$(echo "$MAIL" |tr ',' '\n' |grep "$domain:")
        exclusion=$(echo "$exclusion" |tr ':' '\n' |grep "^$account$")

        # Checking exlusions
        if [ -z "$exclusion" ] && [[ "$MAIL_SYSTEM" =~ exim ]]; then
            echo "$(date "+%F %T") excluding mail account $account" |\
                tee -a $BACKUP/$user.log

    # Compress archive
    if [ ${#accounts[@]} -gt 0 ]; then
        tar -cpf- ${accounts[@]} |gzip -$BACKUP_GZIP - > $tmpdir/mail/$domain/accounts.tar.gz

It looks like

domain.com:account:xxxxxxx will solve you issue

But I need to backup mails accounts with their passwords but not mail data in them (Like mails in webmail)

As you can see config is still backuped if you use:

domain.com:account1,account2 and so on…

Thank you I will re-check. This way would be far better.