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?