www.ProFTPD.de

ProFTPD => ProFTPD - SFV Checker => Thema gestartet von: brmbrm am 23. Mai 2004, 15:38:15



Titel: Move files when 100% ok ?
Beitrag von: brmbrm am 23. Mai 2004, 15:38:15
Is it possible to modify or add something to the scripts of the sfvchecker
so that when all files is 100% crc ok, move everything from upload to a specified folder ?


Titel: Move files when 100% ok ?
Beitrag von: TL am 23. Mai 2004, 17:53:45
Yes, just check the exit-code of the ftpsfv program, If it's 0 everything is ok...

Just add this few lines to ftpsfvcheck.pl:
Add
Code:
$result =
before every
Code:
system(...

After
Code:
closedir DIR;
and before
Code:
exit(0);
add  
Code:
if ($result ==  0)
{
  do_your_copying_here
}


Titel: Move files when 100% ok ?
Beitrag von: Anonymous am 23. Mai 2004, 18:02:45
So..
like this?

Code:

$result = system($ftpsfv." -s \"".$sitename.....

And
Code:

closedir DIR;
if ($result ==  0)
{
  do_your_copying_here
}
exit(0);


Titel: Move files when 100% ok ?
Beitrag von: brmbrm am 23. Mai 2004, 18:07:10
Registered now  :)

How would i write to move the whole dir then ?
Code:

system(mv $path /mnt/otherdisk);


Titel: Move files when 100% ok ?
Beitrag von: TL am 23. Mai 2004, 18:19:16
Zitat von: "Anonymous"
So..
like this?


Yes, but don't forget the second
Code:
system(...


Zitat
Registered now  

How would i write to move the whole dir then ?
Code:

system(mv $path /mnt/otherdisk);


try this
Code:
system("/bin/sh mv ".$path." /mnt/otherdisk");

But I'm not absolutely shure about this...  :roll:


Titel: Move files when 100% ok ?
Beitrag von: brmbrm am 23. Mai 2004, 19:54:52
i tried this:
Code:

rename($path, "/mnt/".$path);

but nothing happened