Backups failing -- ampbackup.pl Missing

Well,

I am starting a new thread with a new title as the old one does not fit. The Backup issue people have been seeing does not appear to be related to the logrotate issue or 2008 calendar year.

For the Logrotate issue see the Problem and solution logged at trixbox.
http://www.trixbox.org/logrotate-does-not

The backup issue seems to be a problem with the ampbackup.pl being removed from where CRON expects it to be.
/bin/sh: /var/lib/asterisk/bin/ampbackup.pl: No such file or directory

The last posting in the previous thread has more details …
http://www.freepbx.org/forum/freepbx/users/backups-in-08-failing

Anyone understand why this function Might come and go on it’s own ??


it is not missing unless the system has been tampered with in some form or way. It is located in the bin directory under the module and automatically symlinked into the /var/lib/asterisk/bin directory by retrieve_conf upon pressing a reload bar which is required after downloading the module or any other configuration change. If you have permission problems, or improper amportal.conf configurations then this could affect the symlink not being there.

this truly a weird problem. i seem to be having it as well! im goining to check if the script is there and report back…

hmm, seems the file is there (or at least the pointer is there). Yet there are no automatic backups… :frowning:

Here is what I have ??

[trixbox1.localdomain /]# ls -la /var/www/html/admin/modules/backup/bin/ampbackup.pl
-rwxrwxr-x 1 asterisk asterisk 9669 Sep 8 14:50 /var/www/html/admin/modules/backup/bin/ampbackup.pl

Are you saying that /var/lib/asterisk/bin/ should be a symbolic Link ?
ln -s /var/www/html/admin/modules/backup/bin/ampbackup.pl /var/lib/asterisk/bin/ampbackup.pl

If so who establishes it and when ? What might break it down ?


retrieve_conf symlinks it when you press the reload bar, along with a bunch of other stuff.

Phillippe.

Which one ?
[trixbox1.localdomain /]# find . -name ‘retrieve_conf’ -print
./usr/src/freepbx-2.3.1/amp_conf/bin/retrieve_conf
./var/lib/asterisk/bin/retrieve_conf
./var/www/html/admin/modules/framework/bin/retrieve_conf

A simple grep does not indicate the presence of the command…
[trixbox1.localdomain asterisk]# grep ampbackup /var/www/html/admin/modules/framework/bin/retrieve_conf
[trixbox1.localdomain asterisk]#

[trixbox1.localdomain asterisk]# grep ampbackup /var/lib/asterisk/bin/retrieve_conf
[trixbox1.localdomain asterisk]#

Also, I went in to force a change / update today and in the GUI again the radio buttons for the Days / Months / Weekdays columns are all checked as “Selected” instead of how I set them which was “All”. for the “Daily” backup as you can see from the first entry in backup.conf.

[trixbox1.localdomain asterisk]# cat backup.conf
30 1 * * * /var/lib/asterisk/bin/ampbackup.pl 1
30 5 * * 0 /var/lib/asterisk/bin/ampbackup.pl 2

run retrieve_conf, as user asterisk, from the Linux command line and see if it complains about the symlink. Your grep won’t show anything, it symlinks anything from bin in any module directory to that location.

Philippe.

Did not see you post last night, but yesterday afternoon in an attempt to get a good backup I copied ampbackup.pl
from where it is to where it was looking for it, not a sym link but a hard copy.

Well last night I got this message from the cron job…

Received: from trixbox1.localdomain (trixbox1.localdomain [127.0.0.1])
        by trixbox1.localdomain (8.13.8/8.13.8) with ESMTP id m0M6U2f8027722
        for <[email protected]>; Tue, 22 Jan 2008 01:30:02 -0500
Received: (from [email protected])
        by trixbox1.localdomain (8.13.8/8.13.8/Submit) id m0M6U260027721;
        Tue, 22 Jan 2008 01:30:02 -0500
Date: Tue, 22 Jan 2008 01:30:02 -0500
Message-Id: <[email protected]>
From: [email protected] (Cron Daemon)
To: [email protected]
Subject: Cron <[email protected]> /var/lib/asterisk/bin/ampbackup.pl 1
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/var/lib/asterisk>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=asterisk>
X-Cron-Env: <USER=asterisk>

No Backup Schedules defined in Backup

Yet /etc/asterisk/backup.conf shows two scheduled jobs, as does the GU for the Back & Restore Module. No changes (red bar) Pending.

[trixbox1.localdomain asterisk]# cat backup.conf
30 1 * * * /var/lib/asterisk/bin/ampbackup.pl 1
30 5 * * 0 /var/lib/asterisk/bin/ampbackup.pl 2


[trixbox1.localdomain ~]# pwd
/var/lib/asterisk
[trixbox1.localdomain ~]# bin/retrieve_conf

Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking for /etc/amportal.conf ..OK
Bootstrapping /etc/amportal.conf ..OK
Parsing /etc/amportal.conf ..OK
Parsing /etc/asterisk/asterisk.conf ..OK
Connecting to database..OK
Connecting to Asterisk manager interface..OK
Added to globals: ASTETCDIR = /etc/asterisk
Added to globals: ASTMODDIR = /usr/lib/asterisk/modules
Added to globals: ASTVARLIBDIR = /var/lib/asterisk
Added to globals: ASTAGIDIR = /var/lib/asterisk/agi-bin
Added to globals: ASTSPOOLDIR = /var/spool/asterisk
Added to globals: ASTRUNDIR = /var/run/asterisk
Added to globals: ASTLOGDIR = /var/log/asterisk
Added to globals: CWINUSEBUSY = true
Added to globals: AMPMGRUSER = admin
Added to globals: AMPMGRPASS = amp111
Please update your modules and reload Asterisk by browsing to your server.
[trixbox1.localdomain ~]#
[trixbox1.localdomain backups]# ls -la *
Daily:
total 144148
drwxrwxr-x 2 asterisk asterisk     4096 Jan 15 01:30 .
drwxrwxr-x 5 asterisk asterisk     4096 Jan  3 01:30 ..
-rw-rw-r-- 1 asterisk asterisk      415 Jan  3 01:30 20080103.01.30.01.tar.gz
-rw-rw-r-- 1 asterisk asterisk 35548312 Jan 11 01:30 20080111.01.30.01.tar.gz
-rw-rw-r-- 1 asterisk asterisk 38363344 Jan 12 01:30 20080112.01.30.01.tar.gz
-rw-rw-r-- 1 asterisk asterisk 38425392 Jan 13 01:30 20080113.01.30.01.tar.gz
-rw-rw-r-- 1 asterisk asterisk 35077269 Jan 15 01:30 20080115.01.30.01.tar.gz

SaveCfg:
total 73936
drwxrwxr-x 2 asterisk asterisk     4096 Jan  1 16:17 .
drwxrwxr-x 5 asterisk asterisk     4096 Jan  3 01:30 ..
-rw-rw-r-- 1 asterisk asterisk 24575989 Jan  1 10:02 20080101.10.01.52.tar.gz
-rw-rw-r-- 1 asterisk asterisk 25539127 Jan  1 14:49 20080101.14.49.13.tar.gz
-rw-rw-r-- 1 asterisk asterisk 25486846 Jan  1 16:17 20080101.16.17.33.tar.gz

Weekly:
total 63244
drwxrwxr-x 2 asterisk asterisk     4096 Jan 13 05:30 .
drwxrwxr-x 5 asterisk asterisk     4096 Jan  3 01:30 ..
-rw-rw-r-- 1 asterisk asterisk 25315257 Jan  3 01:30 20080103.01.30.01.tar.gz
-rw-rw-r-- 1 asterisk asterisk 39357777 Jan 13 05:30 20080113.05.30.01.tar.gz

Cron Indicates no Backups Scheduled…

From [email protected]  Wed Jan 23 01:30:01 2008
Return-Path: <[email protected]>
Received: from trixbox1.localdomain (trixbox1.localdomain [127.0.0.1])
        by trixbox1.localdomain (8.13.8/8.13.8) with ESMTP id m0N6U1TO003676
        for <[email protected]>; Wed, 23 Jan 2008 01:30:01 -0500
Received: (from [email protected])
        by trixbox1.localdomain (8.13.8/8.13.8/Submit) id m0N6U1RK003675;
        Wed, 23 Jan 2008 01:30:01 -0500
Date: Wed, 23 Jan 2008 01:30:01 -0500
Message-Id: <[email protected]>
From: [email protected] (Cron Daemon)
To: [email protected]
Subject: Cron <[email protected]> /var/lib/asterisk/bin/ampbackup.pl 1
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/var/lib/asterisk>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=asterisk>
X-Cron-Env: <USER=asterisk>

No Backup Schedules defined in Backup

Going to delete and recreate the backup schedule again …

So updated and applied the Daily & Weekly backup jobs,

Now I get :
[trixbox1.localdomain asterisk]# cat backup.conf
30 1 * * * /var/lib/asterisk/bin/ampbackup.pl 5
30 5 * * 0 /var/lib/asterisk/bin/ampbackup.pl 4
[trixbox1.localdomain asterisk]#

We will see about a backup in the morning… :frowning:

backup.conf is actually nothing more than a left over scratch file that is used when it is creating the cron jobs. The value it provides is to know what FreePBX tried to set for backups. If you do crontab -lu asterisk you will see what is actually set. If something else interferes with the crontab settings, or some bug makes them not take, then the backups won’t fire.

Phillippe,

It looks the same; What happened to / where do I look for Index 1 2 3 ??

[trixbox1.localdomain ~]# crontab -l
30 1 * * * /var/lib/asterisk/bin/ampbackup.pl 5
30 5 * * 0 /var/lib/asterisk/bin/ampbackup.pl 4
29 * * * * /var/lib/asterisk/bin/freepbx-cron-scheduler.php

On Feb 03rd I got a good Weekly, on Feb 05 I got a good Daily…

On Feb 06th I got …

Subject: Cron <[email protected]> /var/lib/asterisk/bin/ampbackup.pl 5
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/var/lib/asterisk>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=asterisk>
X-Cron-Env: <USER=asterisk>

/bin/sh: /var/lib/asterisk/bin/ampbackup.pl: No such file or directory

There are no messages in /var/log/messages.n for the 5th or 6th indicating an error, and noting in asterisk/full.n either.

Where would one look to debug this and identify why this link is being lost ??

TIA…

after installing the backup module and pressing the Apply Configuration button, that script should automatically be linked to that directory. Try making a change to your system and apply configurations again to get it linked, and if not then uninstall and reinstall the backup module. If this is from an old trixbox system you may find they used to corrupt this module on their installation requiring you to completely delete the module and then installing it from the online repo.

Done on a single TB 2.4.0 no YUM updates…

Same system this whole thread talks about, Between the 5th and 6th nothing was done on the box except hanlde calls.

I want to figure out what caused the link to be removed…

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