From ac22b7abe36a32684eb08cb872014f355b0ea741 Mon Sep 17 00:00:00 2001 From: zhaohui Date: Thu, 8 Jan 2026 15:06:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crontab/del_file.php | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 crontab/del_file.php diff --git a/crontab/del_file.php b/crontab/del_file.php new file mode 100644 index 0000000..6559178 --- /dev/null +++ b/crontab/del_file.php @@ -0,0 +1,70 @@ +=15) { + // 时间超过2小时 + if(filemtime($dir.$v) < time()-3600*2) { + $arr_file_name = explode('_', $v); + $user = $arr_file_name[1]; + + $need_login_file = $dir.'needlogin_'.$user; + //unlink($need_login_file); + //改名 + rename($need_login_file, str_replace('needlogin_', 'del_needlogin_', $need_login_file)); + + $fail_login_file = $dir.'fail_'.$user; + //unlink($fail_login_file); + //改名 + rename($fail_login_file, str_replace('fail_', 'del_fail_', $fail_login_file)); + + //unlink($dir.$v); + rename($dir.$v, str_replace('fail_', 'del_fail_', $dir.$v)); + // 记录日志 + $str_log = date('Y-m-d H:i:s')."|删除登录失败账号文件|".$user; + file_put_contents($log_file, $str_log . PHP_EOL, FILE_APPEND); + } + } + } + + +}