Dot files in /web/domain.com folder not backed up

I just restored from a Hestia CP backup to another server. I noticed when I used the v-restore-user command on my tar file almost everything was copied except for dot files in /home/user/web/domain.com folder. Files such as .env, .gitignore, etc. The dot files inside public_html were copied so no issue there. Has anyone else experienced this issue using the built in Hestia CP backup feature?

Hestia backup doesn’t include hidden files in $HOMEDIR/$user/web/$domain


cd $HOMEDIR/$user/web/$domain
[...]
# Backup files
if [ "$BACKUP_MODE" = 'zstd' ]; then
        tar "${fargs[@]}" -cpf- * | pzstd -"$BACKUP_GZIP" - > $tmpdir/web/$domain/domain_data.tar.zst
else
        tar "${fargs[@]}" -cpf- * | gzip -"$BACKUP_GZIP" - > $tmpdir/web/$domain/domain_data.tar.gz
fi

So, basically it changes to web domain dir and issues a tar [OPTIONS] * and that wildcard won’t include hidden files (dot files) in web domain root folder $HOMEDIR/$user/web/$domain but it will do in subfolders.

3 Likes

Hmm we should include them …

3 Likes

Instead of * I would use . (dot) and it will include all files and folders including hidden ones but it should be tested because the path changes in tar:

From:

dir/
dir/file
file

To:

./
./dir/
./dir/file
./file

It should work fine but it must be tested with v-restore-user just in case.

2 Likes

I think the hidden files should be included in the backup. Some of us developers like to keep our app’s files outside the public_html folder :+1:

1 Like

Also for basic things like .htaccess and .user.ini …

1 Like