?
Solved

How can I monitor an FTP site?

Posted on 2014-11-27
22
Medium Priority
?
139 Views
Last Modified: 2014-12-18
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
Comment
Question by:100questions
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
  • 4
  • +3
22 Comments
 
LVL 23

Expert Comment

by:yo_bee
ID: 40469030
Is this an internal server or you connecting to an external hosted FTP?
0
 

Author Comment

by:100questions
ID: 40469059
Connecting to an external hosted FTP site.
0
 
LVL 35

Expert Comment

by:ste5an
ID: 40469139
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
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 36

Accepted Solution

by:
Kimputer earned 2000 total points
ID: 40469201
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
 
LVL 35

Expert Comment

by:ste5an
ID: 40469210
btw, meant directory traversal, seems there is no verb for it.
0
 
LVL 7

Expert Comment

by:Ray
ID: 40469223
Try setup a job in Allway Sync to sync to a local drive.
0
 
LVL 55

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 40469321
> seems there is no verb for it

traverse
0
 
LVL 35

Expert Comment

by:ste5an
ID: 40469329
hmm, then my online dictionary failed. Thanks.
0
 
LVL 55

Expert Comment

by:Joe Winograd, EE MVE 2015&2016
ID: 40469354
https://en.wiktionary.org/wiki/traverse

Noun shows first. Scroll down for verb.
0
 

Author Comment

by:100questions
ID: 40469451
Ray, is allway sinc software?
0
 
LVL 7

Expert Comment

by:Ray
ID: 40469489
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
 

Author Comment

by:100questions
ID: 40469947
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
 
LVL 7

Expert Comment

by:Ray
ID: 40469966
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
 

Author Comment

by:100questions
ID: 40477684
@Kimputer - it seems that part of that script refers to a 30 day trial.  I'm unsure what that means.
0
 
LVL 36

Expert Comment

by:Kimputer
ID: 40478058
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
 

Author Comment

by:100questions
ID: 40478223
@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
 
LVL 36

Expert Comment

by:Kimputer
ID: 40478419
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
 

Author Comment

by:100questions
ID: 40478604
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
 
LVL 36

Expert Comment

by:Kimputer
ID: 40478629
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
 
LVL 35

Expert Comment

by:ste5an
ID: 40480333
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
 
LVL 36

Expert Comment

by:Kimputer
ID: 40480345
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
 

Author Closing Comment

by:100questions
ID: 40507857
This might work, unsure since I have not tested it at this time.   Thank you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question