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
Solved

How can I monitor an FTP site?

Posted on 2014-11-27
22
127 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
  • 7
  • 5
  • 4
  • +3
22 Comments
 
LVL 22

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 33

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
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 35

Accepted Solution

by:
Kimputer earned 500 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 33

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 53

Expert Comment

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

traverse
0
 
LVL 33

Expert Comment

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

Expert Comment

by:Joe Winograd, EE MVE
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 35

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 35

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 35

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 33

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 35

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Synchronize a new Active Directory domain with an existing Office 365 tenant
This guide will walk you through the essential considerations and tech stack for building scalable websites. Know how to grow your business the smart way!
Using Adobe Premiere Pro, the viewer will learn how to set up a sequence with proper settings, importing pictures, rendering, and exporting the finished product.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

839 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