I try to understand how YNH_BACKUP_DIR is used in yunohost/data/helpers.d/filesystem at this line for example https://github.com/YunoHost/yunohost/blob/c97582938760f43559f15383f0c483563fa09fbb/data/helpers.d/filesystem#L216 . ynh_restore_file have no initialisation of this variable in the function…
I want to use this function to restore only one file after upgrade.
This function is made to run inside restore script. YunoHost cli restore action defines the var YNH_BACKUP_DIR before to call this helper.
You can’t call it directly inside upgrade script. So if you wan’t restore a file inside your upgrade script you shoulc backup it yourself before the upgrade.
Ok, so, I cannot make a granular restoration with helpers, I need to copy to another location and restore.
it’s a regrettable but I understand.