Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Serv-U Event Help: Weekly E-Mail of Uploads?

Sep 19, 2012 1:09PM PDT

New user of Serv-U program, I am trying to learn the great event system on the fly and thought I'd ask to hope some experts are around.

My goal is to have a weekly e-mail of all new uploads, top downloads, etc. be sent out. It is easy to set up an event to send out an e-mail on every individual upload/download, but I couldn't think of a possible combination of filters/commands that would make it occur only once a week and combine them into a single text.

Anybody have experience with this? Or have access to it and be willing to accept the challenge to try and figure it out?

Much appreciated!

Discussion is locked

- Collapse -
Clarification Request
Do you write software? i.e. programming?
Sep 20, 2012 1:16AM PDT

Why I ask is Serv-U from what I see is just another FTP program. Nothing there to excite me. It does not appear to do what you ask so it appears you'll have to add the features you want.
Bob

- Collapse -
Answer
I think you want Serv-U database integration...
Sep 21, 2012 12:38AM PDT

The Serv-U FTP Server lets you store users and related information in a file-based repository or an external database. By default, Serv-U uses the file-based repository, but as long as you have Serv-U Gold or Serv-U Platinum you can switch to database users at any time.

As soon as you start using Serv-U's database-resident users, you can pull user-level and group-level statistics such as number of transfers, total size of transfers, average transfer rate, and number of sign-ons from the user and group records on the database. (See the Serv-U DB Integration Guide for specific schema information.)

The Serv-U team has been busy adding new logging options (features to MSMQ and Windows Event Log are in testing now) but direct database logging won't be ready for a few more months. In the meantime, here's what I would suggest:

1) Create one table in a new DB using the following schema:
"DailyFileStats"
- Date (either date or datetime)
- Path (string)
- Bytes (large integer)
- Count (integer)
- Direction (string)

2) Create a command-line batch file or app (contact me for help with this if you need it) that does this:
- Accepts Date, Path, Bytes, Count and Direction Arguments
- Performs the appropriate INSERT and UPDATE SQL statements to put this information into your DailyFileStats table (the INSERT makes sure the record is there; the UPDATE sets or increments the data)

3) Set up two events in Serv-U:
- File Uploaded: calls your command-line app with Direction = "Upload"
- File Downloaded: calls your command-line app with Direction = "Download"

4) Set up a Windows Scheduled task to run at 00:05 on Sunday (or whenever) to pull the top uploads, downloads, and new files and turn the report into a file.

5) Use automation to mail out the report file.

- Collapse -
Insert SQL data
Mar 15, 2013 1:15AM PDT

Hi,

I find this topic very interesting as I am trying to solve a bit similar problem. I am a new/test user too and I need to log every file upload into a SQL database (MS SQL to be more specific). My goal is to create a simple solution that will archive/delete all files over certain age where the age is based on file upload date. I found out how to log file transfer to a text file using event which is basically what I need, but to be able to log directly into a SQL table would be much better. Can you please point me to a solution on how to insert data direcly to MS SQL server using batch file? I need to log the following information:

Direction (Upload, Download)
username
client IP address
file name
file name incl. path
date
datetime

which translates to this event configuration when I log to the text file:
/C ECHO "FileUpload","$Name","$IP"."$LocalFileName","$LocalPathName","$Day.$Month.$Year","$Day.$Month.$Year $Time" >> D:\Data\FTPlog1.txt

Thanks,
Petr