Backup error permission denied

backup
Tags: #<Tag:0x00007f701ff780f0>

(Jerry Warner) #21
bash-4.2$ chown asterisk:asterisk /var/spool/asterisk/backup/nfs
chown: changing ownership of â/var/spool/asterisk/backup/nfsâ: Operation not permitted

(Sergio Lobera) #22

you need to exit from asterisk user.
Type exit until you see the prompt again (bash)
Then repeat this: chown asterisk:asterisk /var/spool/asterisk/backup/nfs
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.


(Jerry Warner) #23

Same thing.
# chown asterisk:asterisk /var/spool/asterisk/backup/nfs
chown: changing ownership of â/var/spool/asterisk/backup/nfsâ: Operation not permitted
#


(Sergio Lobera) #24

you are still with asterisk user.
Type exit again, or exit from SSH and login again as root.


(Jerry Warner) #25

Exit killed the SSH session. Logged back in again and repeated the command. Same result.


(Sergio Lobera) #26

Type this: whoami

If you don’t see “root”, don’t run the commands cause it’s going to be useless.
If you are root, then type: chown asterisk:asterisk /var/spool/asterisk/backup/nfs
Then type: ls -lah /var/spool/asterisk/backup


(Jerry Warner) #27

Same as before.

# whoami
root
# chown asterisk:asterisk /var/spool/asterisk/backup/nfs
chown: changing ownership of â/var/spool/asterisk/backup/nfsâ: Operation not permitted
# ls -lah /var/spool/asterisk/backup
total 24K
drwxrwxr-x   6 asterisk asterisk 4.0K Oct 13 08:17 .
drwxrwxr-x. 19 asterisk asterisk 4.0K Oct 13 09:30 ..
drwxrwxr-x   2 asterisk asterisk 4.0K Oct  1 00:00 Default_backup
drwxrwxrwx+  2 root     root     4.0K Oct 13 09:12 nfs
drwxrwxr-x   2 asterisk asterisk 4.0K Oct 12 16:38 PBXBackup
drwxrwxr-x   2 asterisk asterisk 4.0K Aug 23 01:53 PBXtoNAS
#

(Sergio Lobera) #28

I think you should try to open a ticket with us, you should be able to change the owner for that directory.


(Jerry Warner) #29

Would this be a paid support ticket on Sangoma or would it be a report on issues.freepbx.org?


#30

likely an acl flag perhaps -i immutable , if the acl package is installed, you can see what the + actually represents

getfacl /var/spool/asterisk/backup


(Jerry Warner) #31
# getfacl /var/spool/asterisk/backup
getfacl: Removing leading '/' from absolute path names
# file: var/spool/asterisk/backup
# owner: asterisk
# group: asterisk
user::rwx
group::rwx
other::r-x

#32

Are you sure it’s a permission issue or is it a connectivity issue? You say the nas has a folder setup for ftp access but you are trying to connect to it using an nfs client using port 21.

You could try setting up the freepbx backup to use an ftp connection I stead of nfs.


(Jerry Warner) #33

I’m only saying it’s a permission problem because that’s what the log is reporting when it fails. The folder is set up for both FTP and as an nfs.

Currently when doing a backup to a different NAS it reports that it backed up successfully. But it’s taking it less than 2 min. to do a total backup including audio files so I have a hard time believing it’s actually backing it up in spite of it reporting success. I don’t have a spare machine laying around to attempt a restore as a way of testing that. I’m a Windows guy (don’t hate me) but when I look at the backup folder it shows the folder as empty.