Backup's in 08 failing?

Okay,

I did the uninstall, cleaned the the files and reinstall per this thread got a couple of backups and then even though nothing has been touched on the box NO Backups again. The Daily ran after the reintall, then the Daily & Weekly ran, then the Daily skipped a day and ran one more time on the 15th, and nothing since ! The reason appears to be that something caused the ampbackup.pl module to be removed as it is not in /var/lib/asterisk/bin/ it’s only in a web directory – Even though it is shown as installed at 2.1.4.8

On the 14th it’s gone…

On the 15th it must of been there as it got the backup.

Then it’s gone again :frowning:

Anyone with any ideas as to what’s going on here ??

== TB 2.4.0 FreePBX 2.3.1.3 Asterisk 1.4.16
Backup & Restore tool 2.1.4.8 Enabled

[trixbox1.localdomain /]# find . -name ‘ampbackup.pl’ -print
./var/www/html/admin/modules/backup/bin/ampbackup.pl

[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

Received: from trixbox1.localdomain (trixbox1.localdomain [127.0.0.1])
by trixbox1.localdomain (8.13.8/8.13.8) with ESMTP id m0E6U1U0008350
for [email protected]; Mon, 14 Jan 2008 01:30:01 -0500
Received: (from [email protected])
by trixbox1.localdomain (8.13.8/8.13.8/Submit) id m0E6U14a008349;
Mon, 14 Jan 2008 01:30:01 -0500
Date: Mon, 14 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>

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

Received: from trixbox1.localdomain (trixbox1.localdomain [127.0.0.1])
by trixbox1.localdomain (8.13.8/8.13.8) with ESMTP id m0G6U1aZ018816
for [email protected]; Wed, 16 Jan 2008 01:30:01 -0500
Received: (from [email protected])
by trixbox1.localdomain (8.13.8/8.13.8/Submit) id m0G6U1lP018815;
Wed, 16 Jan 2008 01:30:01 -0500
Date: Wed, 16 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>

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

Here are the files that were created and when …

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

this truly a weird problem. i seem to be having it as well!

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

Does this make sense to anyone? I don’t understand.

  1. Why did fonality write a script to kill the links?
  2. Why is the script working to kill the links, but not working to copy the files?

Thanks for the fix though!

For debian users:

On my system, there was a crontab error:
The /var/spool/cron/crontabs directory had bad CHMOD.

drwx-wx–T 2 root root 1024 2008-11-05 14:53 crontabs

Asterisk could not write its own crontab! So you have to chmod that dir to:

drwx-wx-wt 2 root root 1024 2008-11-05 14:57 crontabs

to allow writing the crontabs! After that, re-schedulre your backup :wink: