From fcf96d5973c0fea0bce10aad54a0872ad179f25f Mon Sep 17 00:00:00 2001 From: wlx Date: Sun, 27 Oct 2013 05:29:22 +0000 Subject: [PATCH] =?UTF-8?q?#554,=20=E5=AE=9E=E7=8E=B0=E6=8C=82=E8=BD=BD?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E7=9A=84=E5=AE=9A=E6=97=B6=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=EF=BC=8C=E6=AF=8F=E6=9C=88=E8=BF=90=E8=A1=8C=E4=B8=80=E6=AC=A1?= =?UTF-8?q?=EF=BC=8C=E6=B8=85=E9=99=A4=E4=B9=8B=E5=89=8D4=E4=B8=AA?= =?UTF-8?q?=E6=9C=88=E5=88=B03=E4=B8=AA=E6=9C=88=E4=B9=8B=E9=97=B4?= =?UTF-8?q?=E7=9A=84=E7=9B=AE=E5=BD=95=E6=8C=82=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/ftp-umount.php | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tools/ftp-umount.php diff --git a/tools/ftp-umount.php b/tools/ftp-umount.php new file mode 100644 index 00000000..7349ffba --- /dev/null +++ b/tools/ftp-umount.php @@ -0,0 +1,37 @@ +'' + and dataorder.ts_approved=now()-interval '4 months' + and dataorder.selection is null"; + $result = pg_query($link, $sql); + $numrows = pg_num_rows($result); + + $content=''; + for($ri = 0; $ri < $numrows; $ri++) + { + $row = pg_fetch_array($result, $ri); + $content.='# path: '.$row['path']."\n"; + $content.='umount "/home/ftp/westdc_'.$row['userid'].'/'.preg_replace('/^.+[\\\\\\/]/', '', rtrim($row['path'],'/')).'"'."\n"; + } + + $filename='./ftp-umount.sh'; + if (!empty($content)) + if (!file_put_contents($filename, $content, LOCK_EX)) + { + sleep(1); + if (!file_put_contents($filename, $content, LOCK_EX)) + { + sleep(1); + if (!file_put_contents($filename, $content, LOCK_EX)) + die("error in write proftp-user.sh"); + } + } + pg_free_result($result); + pg_close($link); +?> \ No newline at end of file