• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 162
  • Last Modified:

How can I monitor an FTP site?

I would like to monitor an FTP site every 15 minutes, and then report back via email if there are any files which need to be downloaded.
Is there software which will allow me to do this?
If there are files to be downloaded, it simply needs to send out an email to a specific email address informing the recipient that files are ready to be downloaded.
This is in a Windows OS environment.
0
100questions
Asked:
100questions
  • 7
  • 5
  • 4
  • +3
1 Solution
 
yo_beeDirector of ITCommented:
Is this an internal server or you connecting to an external hosted FTP?
0
 
100questionsAuthor Commented:
Connecting to an external hosted FTP site.
0
 
ste5anSenior DeveloperCommented:
You need to scan the entire FTP hierarchy and store it. Then after a rescan you can determine changes. E.g. your new files.

But: Not all FTP servers support this, cause some are hiding the time stamps. Others don't allow to travers folders.
0
SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

 
KimputerCommented:
It's possible, the easiest way if only one fixed location needs to be checked. You could use VBScript with an FTP add on as described here: http://www.example-code.com/vbscript/ftp_listDirectory.asp
Modify it slightly at If (n > 0) Then (cdo mail out alert)
0
 
ste5anSenior DeveloperCommented:
btw, meant directory traversal, seems there is no verb for it.
0
 
RayCommented:
Try setup a job in Allway Sync to sync to a local drive.
0
 
Joe Winograd, EE Fellow 2017, MVE 2016, MVE 2015DeveloperCommented:
> seems there is no verb for it

traverse
0
 
ste5anSenior DeveloperCommented:
hmm, then my online dictionary failed. Thanks.
0
 
Joe Winograd, EE Fellow 2017, MVE 2016, MVE 2015DeveloperCommented:
https://en.wiktionary.org/wiki/traverse

Noun shows first. Scroll down for verb.
0
 
100questionsAuthor Commented:
Ray, is allway sinc software?
0
 
RayCommented:
Allway Sync is a software and there's a free version available depends on your need.

If the ultimate goal is to notify the user to download the newer file, this might be the better way to go.

http://allwaysync.com/

http://allwaysync.com/license.html
0
 
100questionsAuthor Commented:
Ray, will this software notify someone when there is a file to download on the FTP site?
If yes, how does it notify someone, via email?
0
 
RayCommented:
I don't think so; they are setup to sync automatically.  

You have 2 options probably via vbscript/vb.net if you really want to notify someone
1.  Search for the latest changes on the local directory, the notify user
2.  Read the allwaysync log file and determine if new files/folders are created locally, then notify user
0
 
100questionsAuthor Commented:
@Kimputer - it seems that part of that script refers to a 30 day trial.  I'm unsure what that means.
0
 
KimputerCommented:
There's a free version which was written in the "old" way (and therefore free). See the free download link here: http://www.chilkatsoft.com/ftp-activex.asp (right under the orange post title).
If this concerns life or death situations, you should revert to the paid version of course. If it's not, just use the free version and see how reliable it behaves over a period of a month. If nothing weird pops up (like reporting incorrect files, connection issues while a real FTP client doesn't etc), continue to use it. If not, decide if you want to pay for it.
I still use the free version as of  today (in VB.net, vbscript should behave no differently).
0
 
100questionsAuthor Commented:
@Kimputer - Thanks again.  To clarify I can this VB crispt on call, but then I need to download a separate component which is either free or paid for?  If yes, where is that component placed etc.
0
 
KimputerCommented:
In the example it says:

set ftp = CreateObject("Chilkat_9_5_0.Ftp2")

'  Any string unlocks the component for the 1st 30-days.
success = ftp.UnlockComponent("Anything for 30-day trial")

Open in new window


The first SET FTP command, refers to a Chilkat component. It's slightly different for the free version, but the free version registers it with Windows (if you use the installer).

The Unlock command is NOT used in the free version.

So in essence for the free version:

find and DELETE:
success = ftp.UnlockComponent("Anything for 30-day trial")

find:
set ftp = CreateObject("Chilkat_9_5_0.Ftp2")
replace with:
set ftp = CreateObject("ChilkatFTP.ChilkatFTP")

find:
n = ftp.GetDirCount()
replace with:
n = ftp.NumFilesAndDirs

As you might notice, it gets both files and dirs, so it's best to monitor a folder where there shouldn't be any folder underneath.

Of course the code needs to be adjusted much more, but if you intend to follow through with this solution, just tell us the logic you need (check who or what, actions, etc etc), and we'll translate it to code.
0
 
100questionsAuthor Commented:
Thanks.  So to start should I just create a vbs script and then try to run it, or is there an installer of sorts?
0
 
KimputerCommented:
Download Free Chilkat FTP ActiveX, run installer.
You can now use the example VBSscript (with the corrections I made), then program different logic into it. Then run the vbscript.
0
 
ste5anSenior DeveloperCommented:
Just a comment: This FTP component will not solve the conceptual problem, that not all FTP servers provide the necessary information about directory changes.. In those cases you need to download the files, create a hash and store it. Lather, rinse, repeat. Compare the hashes.
0
 
KimputerCommented:
Yes, I already made the assumption it would always be an empty folder, and report back when a file was dropped there.
If that was a wrong assumption, more programming logic needs to be added (either hash, or control file).
0
 
100questionsAuthor Commented:
This might work, unsure since I have not tested it at this time.   Thank you.
0

Featured Post

Will You Be GDPR Compliant by 5/28/2018?

GDPR? That's a regulation for the European Union. But, if you collect data from customers or employees within the EU, then you need to know about GDPR and make sure your organization is compliant by May 2018. Check out our preparation checklist to make sure you're on track today!

  • 7
  • 5
  • 4
  • +3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now