filectime error message help

247SiteAlert's picture

They have: 18 posts

Joined: Oct 2007

My backup script is working ok at making a backup but in the last section where I am deleting backups more than 3 days old, I'm getting a warning msg:

PHP Warning: filectime(): stat failed for db_backup.php on line 176

It's this line:

<?php
$actual_difference
= strtotime(date(\"Y-m-d\")) - strtotime(date(\"Y-m-d\", filectime($app_dir.$save_dir . $v)));
?>

in this code snippet:

<?php
if($remove_sql == \"yes\"){
        exec(\"rm -r -f
$app_dir$save_dir\".$dbname.\"-\".$date.\".sql\");
        echo date(\"F j Y - h:i a\") . \": Immediately removed sql file
$app_dir$save_dir\".$dbname.\"-\".$date.\".sql<br>\";
    } elseif (
$store_len) {
        exec(\"ls
$app_dir$save_dir\",$test_files);
       
$allowed_difference = 86400 * ($store_len - 1);
        foreach (
$test_files as $k=>$v) {
           
$actual_difference = strtotime(date(\"Y-m-d\")) - strtotime(date(\"Y-m-d\", filectime($app_dir.$save_dir . $v)));
            if (is_file(
$app_dir.$save_dir . $v) && ($allowed_difference < $actual_difference)) {
                exec(\"rm -f
$app_dir$save_dir$v\");
                echo date(\"F j Y - h:i a\") . \": Removed file
$app_dir$save_dir$v<br>\";
            }
        }
    }
?>

Can someone help me understand what's wrong?

Free Website Uptime Monitoring
http://www.247SiteAlert.com