Backup Errors -- Can't figure them out

This is a backup to a remote FTP (the file gets uploaded ok). But, there are errors during the process. I’m using the FULL Backup template with no other options/changes.

Here’s the UI Message:

Saving Backup 2...done!
Intializing Backup 2
Backup Lock acquired!
Running pre-backup hooks...
Adding items...
/bin/tar: Removing leading `/' from member names
/bin/tar: Removing leading `/' from member names
/bin/tar: /usr/sbin/acpid: Cannot open: Permission denied
/bin/tar: /usr/sbin/userdel: Cannot open: Permission denied
/bin/tar: /usr/sbin/groupadd: Cannot open: Permission denied
/bin/tar: /usr/sbin/groupmod: Cannot open: Permission denied
/bin/tar: /usr/sbin/userhelper: Cannot open: Permission denied
/bin/tar: /usr/sbin/redhat_lsb_trigger.i386: Cannot open: Permission denied
/bin/tar: /usr/sbin/suexec: Cannot open: Permission denied
/bin/tar: /usr/sbin/ais-keygen: Cannot open: Permission denied
/bin/tar: /usr/sbin/callback: Cannot open: Permission denied
/bin/tar: /usr/sbin/ibmsphalt: Cannot open: Permission denied
/bin/tar: /usr/sbin/build-locale-archive: Cannot open: Permission denied
/bin/tar: /usr/sbin/tzdata-update: Cannot open: Permission denied
/bin/tar: /usr/sbin/tcpd: Cannot open: Permission denied
/bin/tar: /usr/sbin/usermod: Cannot open: Permission denied
/bin/tar: /usr/sbin/groupdel: Cannot open: Permission denied
/bin/tar: Removing leading `/' from hard link targets
/bin/tar: /usr/sbin/useradd: Cannot open: Permission denied
/bin/tar: /usr/sbin/glibc_post_upgrade.i686: Cannot open: Permission denied
/bin/tar: Error exit delayed from previous errors
/bin/tar: Removing leading `/' from member names
Bulding manifest...
Creating backup...
Storing backup...
Running post-backup hooks...
Backup successfully completed!

It looks like you are trying to backup other directories that user asterisk does not have permissions to access.

Any idea how I would go about adding those permissions?

I think the real question is why are you backing up those files? The files in /usr/sbin ate owned by root and the backup run as user asterisk so it does not have access.

I just chose the Full Backup from the templates. I did not add them specifically to the backup set, this is what was pre-configured by FreePBX. So, I’m assuming this is something that SHOULD be backed up.

The full backup template will try to backup system files owned by user root which other users haven’t reading permissions.
For me that’s correct. For instance, when updating to a newer version, we want a full backup to save every single file from an actual running version of asterisk/freePBX.

The problem is, when using freePBX web interface, the backup task is “installed” for running as user asterisk and it can’t read some of the selected files.
The solution would be to install this task in system cron, not in asterisk’s, or change the files’ permissions (I don’t know which one is the safest).

A workaround is to open a ssh shell and run the backup job form the command line as root using:

/var/lib/asterisk/bin/backup.php --id=1


Change the id value to the id of your backup job (the id you can see in the url when you pass the mouse pointer over the backup job name in the web interface).

You can also install it as a system cron job. I think the easer way is to:

  1. configure the backup job to run at a given time (of instance once a week), using the freePBX web interface.
  2. connect as root via ssh
  3. run crontab -u asterisk -l
  4. copy the whole line containing /var/lib/asterisk/bin/backup.php --id=
  5. run crontab -e
  6. paste the copied line, save and exit the editor
  7. finally, back in the web interface, set back "Run Automatically" to "never"

I have seen this bug reported in the tracker and dated to 2010… will it be fixed soon?