Fix for FreePBX backup problem

kerryg
Posts: 6793
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
http://www.VoipStore.com - http://3cxbook.com
(888) VOIPSTORE - (888) 864-7786



philippel
Posts: 700
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 - Apr 27-29, Huntsville, AL



kerryg
Posts: 6793
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
http://www.VoipStore.com - http://3cxbook.com
(888) VOIPSTORE - (888) 864-7786



philippel
Posts: 700
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 - Apr 27-29, Huntsville, AL



philippel
Posts: 700
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 - Apr 27-29, Huntsville, AL



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: 189
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

--

Chris

FtOCC Tech Certified
Top Tier Datacom
Sacramento, CA



philippel
Posts: 700
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 - Apr 27-29, Huntsville, AL



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

This is already in the next build.

--

Kerry Garrison
http://www.VoipStore.com - http://3cxbook.com
(888) VOIPSTORE - (888) 864-7786



kimkhan
Posts: 96
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: 700
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 - Apr 27-29, Huntsville, AL



kolegy
Posts: 2
Member Since:
2010-07-12
can you help?

I install module tbm - Backup tool 2.6.2-19, but it does not work.
Here the log file:

Quote:
File: error_log Line 290 Col 158 50989 bytes 100%
p?home [Mon Jul 12 11:19:15 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:15 +0400 - No event handler for event 'newexten', referer: http://192.168.40.7/maint/index.php?home [Mon Jul 12 11:19:15 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:15 +0400 - Got event.. newexten, referer: http://192.168.40.7/maint/index.php?home [Mon Jul 12 11:19:15 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:15 +0400 - No event handler for event 'newexten', referer: http://192.168.40.7/maint/index.php?home [Mon Jul 12 11:19:15 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:15 +0400 - Got event.. newexten, referer: http://192.168.40.7/maint/index.php?home [Mon Jul 12 11:19:15 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:15 +0400 - No event handler for event 'newexten', referer: http://192.168.40.7/maint/index.php?home [Mon Jul 12 11:19:15 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:15 +0400 - Got event.. newexten, referer: http://192.168.40.7/maint/index.php?home
[Mon Jul 12 11:19:15 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:15 +0400 - No event handler for event 'newexten', referer: http://192.168.40
.7/maint/index.php?home
[Mon Jul 12 11:19:15 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:15 +0400 - Got event.. newstate, referer: http://192.168.40.7/maint/index.ph
p?home
[Mon Jul 12 11:19:15 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:15 +0400 - No event handler for event 'newstate', referer: http://192.168.40
.7/maint/index.php?home
PHP Notice: Use of undefined constant UNKNOWN - assumed 'UNKNOWN' in /var/www/html/maint/modules/home/libs/status.php on line 98 hudlite-server: unrecognized service ■┌ PHP Notice: Use of undefined constant NOTINSTALLED - assumed 'NOTINSTALLED' in /var/www/html/maint/modules/home/libs/status.php on line 82 hudlite-server: unrecognized service % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed ■┌ ■┌ 0 14 0 14 0 0 40 0 --:--:-- --:--:-- --:--:-- 40 ■┌ ■┌ 0 14 0 14 0 0 40 0 --:--:-- --:--:-- --:--:-- 0 ■┌ ■┌ [Mon Jul 12 11:19:16 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:16 +0400 - Got event.. newexten, referer: http://192.168.40.7/maint/index.php?home ■┌ ■┌ [Mon Jul 12 11:19:16 2010] [error] [client 192.168.40.105] Mon, 12 Jul 2010 11:19:16 +0400 - No event handler for event 'newexten', referer: http://192.168.40.7/maint/index.php?home Б■┌ Б■┌ ▓Б■┌ dmesg ■┌ [Mon Jul 12 11:19:49 2010] [error] [client 192.168.40.105] PHP Notice: Undefined variable: _SESSION in /var/www/html/maint/help/configs/menu.php on line 56, referer: http://192.168.40.7/maint/index.php?backup ■┌ lastlog ■┌ [Mon Jul 12 11:19:49 2010] [error] [client 192.168.40.105] PHP Notice: Undefined variable: _SESSION in /var/www/html/maint/help/configs/menu.php on line 57, referer: http://192.168.40.7/maint/index.php?backup maillog.1 ■┌ [Mon Jul 12 11:19:49 2010] [error] [client 192.168.40.105] PHP Notice: Undefined variable: _SESSION in /var/www/html/maint/help/configs/menu.php on line 56, referer: http://192.168.40.7/maint/help/html/?id_nodo=backup [Mon Jul 12 11:19:49 2010] [error] [client 192.168.40.105] PHP Notice: Undefined variable: _SESSION in /var/www/html/maint/help/configs/menu.php on line 57, referer: http://192.168.40.7/maint/help/html/?id_nodo=backup┌ Б■┌ ┌ messages ■┌ [Mon Jul 12 11:19:49 2010] [error] [client 192.168.40.105] PHP Notice: Undefined variable: URLBase in /var/www/html/maint/help/libs/paloSantoTree.class.php on line 55, referer: http://192.168.40.7/maint/help/html/?id_nodo=backup ■┌ ■┌ [Mon Jul 12 11:19:49 2010] [error] [client 192.168.40.105] PHP Notice: Undefined index: nodeserial in /var/www/html/maint/help/html/frameLeft.php on line 56, referer: http://192.168.40.7/maint/help/html/?id_nodo=backup ■┌ ■┌ [Mon Jul 12 11:19:50 2010] [error] [client 192.168.40.105] PHP Notice: Undefined variable: _SESSION in /var/www/html/maint/help/configs/menu.php on line 56, referer: http://192.168.40.7/maint/help/html/?id_nodo=backup ■┌ ■┌ [Mon Jul 12 11:19:50 2010] [error] [client 192.168.40.105] PHP Notice: Undefined variable: _SESSION in /var/www/html/maint/help/configs/menu.php on line 57, referer: http://192.168.40.7/maint/help/html/?id_nodo=backup ■┌ ■┌ [Mon Jul 12 11:19:50 2010] [error] [client 192.168.40.105] File does not exist: /var/www/html/images/bgGrayHoriz.gif, referer: http://192.168.40.7/maint/help/html/frameLeft.php?id_nodo=backup ■┌ ■┌ [Mon Jul 12 11:19:56 2010] [error] [client 192.168.40.105] File does not exist: /var/www/html/maint/null, referer: http://192.168.40.7/maint/index.php?backup [Mon Jul 12 11:29:13 2010] [error] [client 192.168.40.105] File does not exist: /var/www/html/maint/null ■┌ [Mon Jul 12 11:29:16 2010] [error] [client 192.168.40.105] File does not exist: /var/www/html/maint/null ■┌ ■┌ [Mon Jul 12 11:29:23 2010] [error] [client 192.168.40.105] File does not exist: /var/www/html/maint/null ■┌ ■┌ gunzip: cache/xml/primary.xml already exists; not overwritten [Mon Jul 12 11:30:24 2010] [error] [client 192.168.40.105] File does not exist: /var/www/html/maint/modules/repo/includes/css/modules, referer: http://192.168.40.7/maint/index.php?repo& [Mon Jul 12 11:32:25 2010] [error] [client 192.168.40.105] File does not exist: /var/www/html/admin/images/logo.png, referer: http://192.168.40.7/admin/config
.php
1Help 2UnWrap 3Quit 4Hex 5Line 6RxSrch 7Search 8Raw 9Unform 10Quit


SkykingOH
Posts: 9675
Member Since:
2007-12-17
trixbox is based on FreePBX

trixbox is based on FreePBX 2.5. You can't use the 2.6 version

--

Scott

aka "Skyking"



kolegy
Posts: 2
Member Since:
2010-07-12
thanks

thanks



stechnique
Posts: 733
Member Since:
2008-02-21
Skyking I believe this is

Skyking I believe this is the tbm- module and not the FreePBX module so surely it should be compatible with trixbox!
There's a lot of problems with tbm-backup, what version of trixbox are you running?



Comment viewing options

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