| Justin Patrin 2006-06-17, 8:12 am |
| On 6/14/06, Ed Zenisek <ed@duskrider.com> wrote:
> 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, w s, and months. Those files are then zipped up and mailed off. The class is called like this:
> if ($tar->add("days w s 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.
>
Are you sure it's an ininite loop in Archive_Tar? It could be an
infinite loop in the script you're using. I suggest putting echo
statements in various parts of the script (starting at the beginning)
to see where the problem lies.
--
Justin Patrin
|