I’m trying to get a successful backup FreePBX 14.0.13.40, Asterisk 13.32.0. I’m backing up to a WD NAS drive using Backup and Restore 10.0.10.11 using the Full Backup Template The path in the server setup is //192.168.xxx.xxx/nfs/PBX
Initializing Backup 5
Backup Lock acquired!
Running pre-backup hooks…
Adding items…
Building manifest…
Creating backup…
Storing backup…
Could not connect to server nfs://192.168.xxx.xxx/nfs/PBX:21
Whoops\Exception\ErrorException: mkdir(): Permission denied in file /var/www/html/admin/modules/backup/functions.inc/class.backup.php on line 356
Stack trace:
It appears it’s a user name/permission issue. What user name an password is FreePBX trying to use here? I even tried setting the Share user to any puplic user and allowing anonymous Read/write, but it still fails.
I’d sure feel better if I had a backup of the system somewhere.
So that did let me test. It still failed. But it tested quickly. Thank you.
It still seems to be a permission thing on the NFS but how can I tell what login and password FreePBX is trying to use so I can add it to the NFS permission? Or the other way around, where do I set that on FreePBX?
As a test I set it to backup to a different NAS, an Iomega. It zips through the process but I wonder if it’s really there. From start to finish for a full system backup including all CDR and recordings took less than 2 min. Could it really have done a backup of everything that quickly?
The NAS is set up in the FreePBX GUI under the Servers tab with the hostname of nfs://192.168.xxx.xxx/nfs/PBX on Port 21. The share on the NAS is setup with Public FTP access turned on (anonymous Read/Write) with a mount point of nfs://192.168.xxx.xxxx/nfs/PBX so it should have access. I don’t know why it’s getting a permission error.
I’m afraid I don’t know how to create a mount in directory you suggest. My Linux is poor.
Is the error because I need the entire mount point instead of just the IP? ie replace //192.168.xxx.xxx with //192.168.xxx.xxx/nfs/PBX? Or do I need to lose the // before the IP?
mount: wrong fs type, bad option, bad superblock on //192.168.xxx.xxx:/PBX,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount. helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so.
So I tried mount -t nfs://192.168.xxx.xxx/nfs/PBX /var/spool/asterisk/backup/nfs and got this error.
mount: can’t find /var/spool/asterisk/backup/nfs in /etc/fstab
Install nfs-utils first: yum install nfs-utils
After that, the command should be: mount -t nfs 192.168.xxx.xxx:/PBX /var/spool/asterisk/backup/nfs
Are you 100% sure that your “PBX” folder is on the root directory (talking about the NAS)
If that command didn’t work, try with this one, just in case PBX is inside “nfs”
Also, saw some NFS where is not the same NFS or nfs, so be sure to write the way you have it on your NAS.
After that, the command should be: mount -t nfs 192.168.xxx.xxx:/nfs/pbx /var/spool/asterisk/backup/nfs
The mount point listed in the NAS is
Mount Point: nfs://192.168.xxx.xxx/nfs/PBX
To me that looks like the PBX isn’t on the root, but is in a directory called nfs?
It appears the second command mounted. At least it didn’t generate an error so I assume it worked.
# mount -t nfs 192.168.xxx.xxx:/nfs/PBX /var/spool/asterisk/backup/nfs
# mount.nfs: access denied by server while mounting 192.168.xxx.xxx:/PBX
-bash: mount.nfs:: command not found
# mount -t nfs 192.168.xxx.xxx:/nfs/PBX /var/spool/asterisk/backup/nfs
#
However if I then try to run a short backup I still get the same Permission denied error.
So, you need to move to asterisk user, you should do a su asterisk
Then type “whoami” and then the touch command.
The idea is to see if you have rights to write into that directory.
So that’s the reason, the nfs directory is owned by root
Run this command: chown asterisk:asterisk /var/spool/asterisk/backup/nfs
Then, run again: ls -lah /var/spool/asterisk/backup
if you see that “asterisk” is the new owner, then go and try to run the backup job again.