Backup and Restore Permissions

I’m trying to create a full system backup for migration to FreePBX 17 that includes some custom files and applications. Specifically, I’m trying to follow this guide for backing up FOP2 that mentions including the /usr/local/fop2 directory. I also have a directory in the root of the filesystem I would like to include (eg. /custom) and some other custom check-mk monitoring scripts in the /usr/share/check-mk-agent/ directory. I’ve changed directory permissions on the main server to allow these directories to be included in the backup, but when the new FreePBX 17 server tries to create these directories that don’t exist it gets an error saying something like “Failed to create “/usr/local/fop2”: mkdir(): Permission denied”. fwconsole chown doesn’t change the permissions on these directories so no help their either.

Naturally, the restore process run as the asterisk user can’t create a file in the /usr/local or usr/share directories since those are owned by root. I can maybe install these programs ahead of time, or just manually create these directories with the correct permissions, and then just copy over these files during the restore. But I’d like to have a completely self contained backup with all of my custom programs and scripts within it that can be restored to a default FreePBX install. I don’t understand how, but it seems it must be possible because it’s being done in the linked guide for backing up FOP2. Is the assumption that FOP2 has already been installed (and those the /usr/local/fop2 directory already exists) on the new server that is being restored to?

You can add files to the chown config…
https://sangomakb.atlassian.net/wiki/spaces/FP/pages/10289397/FreePBX+Chown+Conf

Are you recommending I change the permissions on /usr/local and /usr/share via chown before running the restore script? Or should I create the desired directories first and then add them to the chown config? I’m worried about adjusting the permission on the system directories. If I need to create the directories ahead of time, I could probably manually set their permissions just as easily as updating the chown config. Is chown run as part of the restore process?

My recommendation would be for the FOP guys to create a proper module so everything works the way it should. Outside of that there are a hundred ways to skin a cat. I would take the easiest route for you. Creating the directories with the right permissions would probably be the way to go.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.