Hi All,
I was reading all documentation & sample scripts and I was also trying to find the answer to my question in the Forum but I couldn't find it therefor I post it
Is there a way to return a certain code when the SYNC function has synchronized atleast 1 changed/new file ?
I'll explain bit more:
I have a script that is synchronizing a whole directory on an ftp server with a local directory.
As soon as 1 file is changed the admin has to receive an email (for which I use BLAT)
So I don't need to send an email when the synchronizing is succesful. I only need to send a mail when at least 1 file has been downloaded because it has been changed.
Is this possible ?
All help is appreciated.
Best Regards,
Karel
I was reading all documentation & sample scripts and I was also trying to find the answer to my question in the Forum but I couldn't find it therefor I post it
Is there a way to return a certain code when the SYNC function has synchronized atleast 1 changed/new file ?
I'll explain bit more:
I have a script that is synchronizing a whole directory on an ftp server with a local directory.
As soon as 1 file is changed the admin has to receive an email (for which I use BLAT)
So I don't need to send an email when the synchronizing is succesful. I only need to send a mail when at least 1 file has been downloaded because it has been changed.
Is this possible ?
All help is appreciated.
Best Regards,
Karel
Hello Karen,
There is a command called GETTRANSFERREDFILESCOUNT that returns the number of files that have been transferred. It is a very rare command and this is because you will not find it under the command list in the Documentation section. You need to visit the topic "Advanced topics and rare features":
http://www.scriptftp.com/reference.php?go=topic560
Here it is an example:
[scriptftp="transfered_file_count.ftp"]SYNC("C:\mylocaldir","/myremotedir",UPLOAD)
IF(GETTRANSFERREDFILESCOUNT()>0)
PRINT("Some files were transfered")
ELSE
PRINT("No files transfered")
END IF[/ScriptFTP]
There is a command called GETTRANSFERREDFILESCOUNT that returns the number of files that have been transferred. It is a very rare command and this is because you will not find it under the command list in the Documentation section. You need to visit the topic "Advanced topics and rare features":
http://www.scriptftp.com/reference.php?go=topic560
Here it is an example:
[scriptftp="transfered_file_count.ftp"]SYNC("C:\mylocaldir","/myremotedir",UPLOAD)
IF(GETTRANSFERREDFILESCOUNT()>0)
PRINT("Some files were transfered")
ELSE
PRINT("No files transfered")
END IF[/ScriptFTP]
liked Script FTP? Try our other product Email Parser