Solved

How can I monitor an FTP site?

Posted on 2014-11-27
22
122 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 21

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 32

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
 
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 32

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 51

Expert Comment

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

traverse
0
 
LVL 32

Expert Comment

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

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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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 32

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
The viewer will learn common shortcuts with easy ways to remember them. The viewer will then learn where to find all of the keyboard shortcuts, how to create/change them, and how to speed up their workflow.
XMind Plus helps organize all details/aspects of any project from large to small in an orderly and concise manner. If you are working on a complex project, use this micro tutorial to show you how to make a basic flow chart. The software is free when…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now