ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
I'm looking for a way to do a combination of a couple of things. Would it be possible to have an e-mail sent when new files are added to an FTP site. A plus would be to have the e-mail contain info on what folders have new content.
This is only a sketch but a first approach would be ask the server for a file list every 30 seconds. Compare the new list with the last one and if they are different send an email. Something like:


[scriptftp file="check_for_file_list_changed.ftp"]:start

GETLIST($list1,REMOTE_FILES)
IF($list1!=$list2)
# file lists are different. Send an email here. See the help topic:
# http://www.scriptftp.com/reference.php?go=topic123
END IF

# Wait 30 seconds
SLEEP(30)

$list2=$list1

# Jump to the beginning
GOTO :start[/ScriptFTP]