Regarding Archive_Tar and infinite loop.
| From: | Ed Zenisek | Date: | Wed, 14 Jun 2006 14:05:56 +0000 |
| Subject: | Regarding Archive_Tar and infinite loop. | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-24356@lists.php.net to get a copy of this message | ||
Hello, thanks for taking the time to read my e-mail.
I recently began working with a script to backup mySQL databases via php, and the Archive_Tar class
is used to compress the backup .sql files. The overall script seems to work, but when it tries to
tar up the files, it goes into an infinite loop.
I must admit that I'm using a script I obtained online from another source
(http://restkultur.ch/personal/wolf/scripts/db_backup/) and I'm not very familiar with
Archive_tar or Pear.
The script I'm using backs up files into three directories: days, weeks, and months. Those
files are then zipped up and mailed off. The class is called like this:
if ($tar->add("days weeks months")) {
When I run the script, I do eventually get a tar.gz file, however it only contians one .sql file
repeated over and over (presumably until some internal stop mechanism kicks in and halts the
script). This file is located within the 'days' folder inside the tar.gz file. It looks
something like
[]days
my_backup.2006-07-13.sql
my_backup.2006-07-13.sql
my_backup.2006-07-13.sql
my_backup.2006-07-13.sql
my_backup.2006-07-13.sql
etc.
etc.
I think I have it narrowed down to the for statement in _AddList, however I could be mistaken.
for ($j=0; ($j < count($p_list)) && ($v_result); $j++) {
It seems to be the only place a loop could occur.
The 'days' folder on my server currently contains two files... my_backup.2006-07-13.sql
and my_backup.2006-07-14sql. The first file is the one repeated.
I've been through the code, and would say my php knowledge is moderate... but I can't seem
to grasp what's going on here. Any help would be greatly appreciated.
Thanks!
-Ed Zenisek
www.duskrider.com