Backup module issue

SNG7, 14.0.1beta2

I received the following error when I tried to do a full backup to a USB drive:

I have the local server path set to /media/ which is the root of the USB stick (I can see it just fine from the CLI). I suspect the path may need some other info?

Initializing Backup 3
Backup Lock acquired!
Running pre-backup hooks...
Adding items...
Building manifest...
Creating backup...
Storing backup...
Whoops\Exception\ErrorException: mkdir(): Permission denied in file /var/www/html/admin/modules/backup/ on line 356
Stack trace:
1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/backup/
2. mkdir() /var/www/html/admin/modules/backup/
3. FreePBX\modules\Backup\Backup->store_backup() /var/www/html/admin/modules/backup/bin/backup.php:145


As far as I can tell, both from the error message and from what is in class.backup.php (assuming line 356 in class.backup.php is the same as mine) it’s because the asterisk user/group doesn’t have write permission there…

The backup module is trying to create a folder and it is failing with a permission denied…

You need to change the permissions on /media…

Good luck and have a nice day!


So here is a dumb question, how do I do that? I tried chmod 777 /media/ but the backup still failed.


please run chown -R asterisk.asterisk /media

Thank you,

Daniel Friedman
Trixton LTD.

This is what I get when I issue that command (the edgeos_ubnt file is on the usb stick to make sure I was mounted and looking at the right place):

chown: changing ownership of ‘/media/System Volume Information/WPSettings.dat’: Operation not permitted
chown: changing ownership of ‘/media/System Volume Information/IndexerVolumeGuid’: Operation not permitted
chown: changing ownership of ‘/media/System Volume Information’: Operation not permitted
chown: changing ownership of ‘/media/edgeos_ubnt_20161227.tar.gz’: Operation not permitted
chown: changing ownership of ‘/media’: Operation not permitted


Can you share the mounting line in the fstab? I have the feeling that it is a read only mount.
If it is not in the fstab file, can you share your mounting method?

Thank you,

Daniel Friedman
Trixton LTD.

Here is the fstab file, and it doesn’t look like it is in there:

/dev/mapper/SangomaVG-root /                       xfs     defaults        0 0
UUID=5c2a95f3-0106-4f5c-b81d-238e908478df /boot                   ext4    defaults        1 2
/dev/mapper/SangomaVG-swaplv1 swap                    swap    defaults        0 0

I mounted the drive with:
sudo mount /dev/sdb1 /media

When I switch to /media I do see the contents of the USB stick. I was able to write out a test file to /media so I don’t think it’s read only?

Try this:

Log into the console as “root” and then …

I was logged in as root when I issued that command.

The asterisk user needs to have access and permissions to the mount point I would do the mount something like

mount -t vfat /dev/sdb1 /var/spool/asterisk/FAT32 -o rw,uid=1000,gid=1000 (or whatever the uid/gid of thae asterisk user is)

after making that directory and running fwconsole/amportal chown.

(FAT32 file systems don’t support many of the Linux file permissions)