Guide: Monitor sftp folder for new files
Do you have an sftp folder where are you putting files on a daily basis? How can you be sure that those files are being created? In this article, we will cover how to monitor the sftp folder for new files.
Creating new task
To set up folder tracking you need to register at Verfio and verify your email. Once you are registered you will see a task page. This page is displaying your sftp task. You are free to create one by clicking on the "New task" button.
Each task must have a name, our will be called "new files monitor".
Setting up connection
Below the task name, you will find the connection section. Where you can pick your connection type (SFTP), hostname, port, username, and password for your sftp connection.
Picking directory
Once you have your sftp credentials filled up, you can now click on directory path input. This will open a modal page for you where you can browse your folders inside your sftp server. Pick a folder where new files are being created.
Once you have your folder picked, click on the test connection to verify that everything is okay.
Adding rules
The next step is to set up rules for tracking. Scrolling down to the rules section you will see add rule button. After clicking on this button three input boxes appear.
Since we want to track new files inside the folder, we will set up the property to last modified. Our condition will be Not older than and Days value is 1.
This way we will track the folder for new files that are not older than 1 day.
By clicking on the test result you will see, how many files passed this rule.
The result of this test (passed files count), should be 1.
So we can now set up an Expected result rule. We expect that every time we run our test there should be only 1 file not older than 1 day.
So we set up our result count equal to 1.
Or you can set up your expected result rule to be greater than 1. (this way if more than 1 file is created on the day you will not get spammed by notifications)
Setting run frequency
As a final step in our setup, we will need to set up a run frequency. We want to track our files daily, our files are being created at 4 am so to be sure that we did not run our test sooner than the files are being created we will set up our test to run at 5 am.
Our server is creating files at 4 am in the UTC timezone, but if you don't know the timezone where are you server located you can modify the timezone to use your hour's shift. For example, if I am seeing files being created at 10 pm Los Angeles time I just pick this timezone and I don't need to worry about calculating when should your test run.
Getting notified
After setting up everything, you need to scroll to the top of the page and click on the active flag to mark this task as active, and hit create button.
This task should be visible as active inside your tasks table.
Verfio will now trigger a watcher at your desired time. If files won't match your rules you will get notified instantly. But, you will receive a notification only if something is wrong. So you won't be spammed.
To verify that your sftp folder is being tracked you need to go to the task page a few minutes after the scheduled test was run. you will see a history button on which you can click, this will display a log of results. So you will see exactly when and how verfio triggers a watcher.
Conclusion
So we covered how to track folders for new files with verfio. As you can see verfio is a powerful SFTP monitor which can track your files. You will get notified only if something bad happens, so your inbox won't be spammed by every day checks, and you can use verfio for free.