Either synology won't let me do this, or my php script is bad
I've created my user defined script, so I used this as the script to call "php /volume7/homes/admin/scripts/ach_clean.php"
<?php
$files = glob(cacheme_directory()."/volume6/corp/AcctsPayable/*");
$now = time();
foreach ($files as $file)
if (is_file($file))
if ($now - filemtime($file) >= 60 * 60 * 24 * 7) // 7 days
fopen($file + ".test", "w");
//unlink($file);
?>
答案 0 :(得分:0)
forget PHP. It doesnt work as needed.
I just use shell instead. Simple, one liner.
find /volume6/corp/AcctsPayable/ -mindepth 1 -mtime +7 -delete