FreePBX Version
FreePBX 16/17
Issue Description
When a backup job writes to a Filestore location with Append Backup Name as a directory to the Storage path = Yes, the backup file is correctly created under:
<storage path>/<backup_name>/<backup-file>
However, that backup does not appear in the Backup & Restore restore UI under the local/cloud cache unless the Filestore path is changed to point directly at the generated <backup_name> subdirectory.
Steps to reproduce
- In Filestore, create a local storage location pointing to a mounted USB path such as:
- In Backup & Restore, create or edit a backup job.
- Select the Filestore location above as a storage target.
- Set Append Backup Name as a directory to the Storage path to Yes.
- Run the backup.
- Confirm from CLI that the backup exists in:
/mnt/backup/<backup_name>/
- and also in
/var/spool/asterisk/backup/<backup_name>/
- Open the restore UI and check the available files in local/cloud cache.
Actual behavior
The backup stored in the Filestore location under /mnt/backup/<backup_name>/ is not shown in restore cache browsing.
Expected behavior
If backup storage intentionally writes to:
<storage path>/<backup_name>/<backup-file>
then restore/cache discovery should also find and display those backups when browsing that Filestore location.
Workaround
If the Filestore path is changed to the full generated subdirectory, for example:
/mnt/backup/<backup_name>
then the backups become visible in restore browsing.
Another workaround is to disable Append Backup Name as a directory to the Storage path so files are written directly under the configured storage path.
Notes
The write-side behavior appears intentional in Handlers/Storage.php:
if (isset($this->backupInfo['backup_addbjname']) && $this->backupInfo['backup_addbjname'] == 'yes') {
if ($info['driver'] == 'Email') {
$Rfile = basename((string) $this->file);
} else {
$Rfile = $this->backupInfo['backup_name'].'/'.basename((string) $this->file);
$this->freepbx->Filestore->makeDirectory($id, $this->backupInfo['backup_name']);
}
}
This suggests the bug is likely on the restore/cache discovery side, where Filestore-backed browsing may not be recursing into the generated backup-name subdirectory even though the storage writer places files there by design.
Operating Environment
- Module:
FreePBX/backup Latest 17
- Related module:
FreePBX/filestore
- Filestore type: Local path on mounted USB drive
- Example storage path:
/mnt/backup
Relevant log output
FreePBX Version
FreePBX 16/17
Issue Description
When a backup job writes to a Filestore location with Append Backup Name as a directory to the Storage path = Yes, the backup file is correctly created under:
<storage path>/<backup_name>/<backup-file>However, that backup does not appear in the Backup & Restore restore UI under the local/cloud cache unless the Filestore path is changed to point directly at the generated
<backup_name>subdirectory.Steps to reproduce
/mnt/backup/mnt/backup/<backup_name>//var/spool/asterisk/backup/<backup_name>/Actual behavior
The backup stored in the Filestore location under
/mnt/backup/<backup_name>/is not shown in restore cache browsing.Expected behavior
If backup storage intentionally writes to:
<storage path>/<backup_name>/<backup-file>then restore/cache discovery should also find and display those backups when browsing that Filestore location.
Workaround
If the Filestore path is changed to the full generated subdirectory, for example:
/mnt/backup/<backup_name>then the backups become visible in restore browsing.
Another workaround is to disable Append Backup Name as a directory to the Storage path so files are written directly under the configured storage path.
Notes
The write-side behavior appears intentional in
Handlers/Storage.php:This suggests the bug is likely on the restore/cache discovery side, where Filestore-backed browsing may not be recursing into the generated backup-name subdirectory even though the storage writer places files there by design.
Operating Environment
FreePBX/backupLatest 17FreePBX/filestore/mnt/backupRelevant log output