I am trying to create a php script that will be call'ed by a cron to perform some task on files then move them to another directory.
right now the files are moved to USER/$Xreg but are still in the tmp why?
I can not get them to delete out of the tmp.
I can not unlink them.
I would love to just move them
File are placed in the tmp dir via ws_ftp from many locations. (not http)
This is the top level dir list /home
drwxrwxrwx 7 xyz xyz 4096 Apr 15 05:51 USER
drwxrwxrwx 2 xyz apache 4096 May 3 23:59 tmp
this is the sub dir of USER
drwxrwxrwx 2 48 apache 4096 May 6 21:24 r1
//snipit
$tmp_path= "/home/xyz/tmp/";
$handle = opendir("$tmp_path");
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "$file<br>";
$Xreg = 1;
$path = "/home/xyz/USER/";
$subpath = "r".$Xreg."/"; //move file to user region dir
//move file to correct region dir after working with them
system("mv ".$tmp_path.$Xmyfile." ".$path.$subpath.$Xmyfile);
}
}
//end snipit