Fix for FreePBX backup problem
There seems to be a bug in the current FreePBX build that is preventing scheduled backups from working. Our man Tim (send him some beer for this one) came up with a simple fix for now:
in
/var/www/html/admin/modules/backup/bin/retrieve_backup_cron_from_mysql.pl
Change this line very close to the bottom:
system ("/usr/bin/crontab -l | grep -v ^#\ DO\ NOT | grep -v ^#\ \( | grep -v ampbackup.pl >> $Backup_cron ");
To look like this:
system ("/usr/bin/crontab -l | grep -v ^\"# DO NOT\" | grep -v ^\"#\" | ( grep -v ampbackup.pl >> $Backup_cron ) ");
Kerry,
as discussed, I don't think that is keeping backups from happening. That line of code has been in there since November 4, 2006. If you take a closer look you will see that the syntax is correct. It is related to the following original bug:
http://freepbx.org/trac/ticket/990
Making the change above would actually break the fix that is in place because of some versions of crontab although probably nothing that would effect trixbox specifically. The "(" in question is simply part of a pattern match to remove un-needed garbage when rebuilding the crontab entries as a result of adding or removing backup sets.
Since the command is simply a "system()" command - you should be able to setup your test environment and then run the test manually to see what output is being generated if you suspect something odd going on there. However keep in mind that the specific line mentioned above, if it were failing, would either result in the deletion of non-backup cron jobs owned by asterisk (such as are handled by the freepbx cron manager where backup will eventually be pushed) or it would introduce a duplication of of the backup command since it is another part of the code which is actually creating the backup jobs.
So feel free to submit a ticket into the FreePBX ticket system if you isolate something down from your additional testing.
Hi,
I finally figured why the ampbackup.pl link was being deleted. It was a Trixbox issue. It turns out that if you open the maint web page (http://{ip address}/maint), of your Trixbox, a script runs that deletes all the symbolic links in /var/lib/asterisk/bin.
To prevent this from happening edit file:
/var/www/html/maint/includes/application_top.php
and around line 32 change this line:
unlink($backupCode_location.$value);
to:
//unlink($backupCode_location.$value);
Ricardo
If the ampbackup.pl file was already deleted then you may need to re-established the symlink by issuing this command after you do the above fix:
ln -s /var/www/html/admin/modules/backup/bin/* /var/lib/asterisk/bin/
Edit:
Ignore this command. Follow what Philippe mentioned in his post above.
Thanks Philippe, Ricardo and Kerry for your support on this.
instead of 'second guessing' the system, like apparently the original author of this application_top.php script did, just follow-through with the removal of this problem code and then do something that makes FreePBX allow you to 'Apply Configuration Changes' with the orange bar. It will take care of the linking for you and make sure to do it with the proper ownership and permissions.

Member Since:
2006-05-31