Fix for FreePBX backup problem

kerryg
Posts: 6062
Member Since:
2006-05-31

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 Garrison
trixbox Community Director
trixbox Pro Standard Edition - It's Free too!
http://voipspeak.net - http://asterisktutorials.com



philippel
Posts: 658
Member Since:
2006-05-31
Kerry, as discussed, I don't

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.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Oct 7-10, Digium's HQ



kerryg
Posts: 6062
Member Since:
2006-05-31
We will do some more testing

We will do some more testing in the morning but it is not working by default in 2.6.0.2 and this change seemed to fix it.

--

Kerry Garrison
trixbox Community Director
trixbox Pro Standard Edition - It's Free too!
http://voipspeak.net - http://asterisktutorials.com



philippel
Posts: 658
Member Since:
2006-05-31
Since the command is simply

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.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Oct 7-10, Digium's HQ



philippel
Posts: 658
Member Since:
2006-05-31
Just checking in here - Is

Just checking in here - Is it a correct assumption given no more info and no bugs on the FreePBX Forum that this did not pan out? We love fixing bugs and making a better product so let us know!

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Oct 7-10, Digium's HQ



ricvil
Posts: 10
Member Since:
2007-11-28
Solved

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



csgcomm
Posts: 135
Member Since:
2007-01-09
You are da man. Just tested

You are da man. Just tested scheduled backup and it WORKS. Make sure you post new thread with your findings so Karry can see it and blog it and everyone can benefit from this great news.

Chris



philippel
Posts: 658
Member Since:
2006-05-31
Please post a bug in the

Please post a bug in the trixbox bug tracker on this issue.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Oct 7-10, Digium's HQ



kerryg
Posts: 6062
Member Since:
2006-05-31
This is already in the next

This is already in the next build.

--

Kerry Garrison
trixbox Community Director
trixbox Pro Standard Edition - It's Free too!
http://voipspeak.net - http://asterisktutorials.com



kimkhan
Posts: 82
Member Since:
2007-03-07
You may also need to issue the symlink

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.



philippel
Posts: 658
Member Since:
2006-05-31
instead of 'second guessing'

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.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Oct 7-10, Digium's HQ



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.