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