FTP monitoring


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers FTP monitoring
# 1  
Old 07-26-2010
Question FTP monitoring

Hello there,

I have the following situation : I have a ftp server (PureFTPd)on which users can connect and put their files. The thing is I need to synchronize the files uploaded by the users to another server (so that everybody can download (via http) from that server the resources uploaded by the each of them). Right now, I do this thing manually, after the user alerts me that he uploaded new files to his box.
The problem is not, how to transfer files from a place to another, but how to monitorize when a user uploads new files ?
Checking permanently the log file would be a solution, but is to inefficient. I need/want something that alerts me when a user disconnects from server, and then run the synchronize script.
So, is there any way I can do this ?


Thanx,
Adrian
# 2  
Old 07-26-2010
#man rsync
# 3  
Old 07-26-2010
Wouldn't it be a help if you have the synchronization running automatically in the background for those 2 servers?
If so, then you might want to implement rsync. Should there be nothing new and there is a run of rsync, then there will be nothing updated (depending which options of rsync you use).

Else you might want to check if your pureftpd has some extended logging that you could parse and trigger mails etc.
# 4  
Old 07-26-2010
As I said, the problem is not how to copy the files( rsync job ), but how to trigger rsync to synchronize things, after the user has left (and eventually added files). This I don't know.
# 5  
Old 07-26-2010
Why not have it triggered every minute by cron? When it starts it checks for a lock-file under /var/run for example. If it doesn't find one, it creates a lock-file and starts the rsync. If it finds a lock-file, it exits and waits for it's next call via cron. So if a job needs 5 minutes, next job will just run after that.
# 6  
Old 07-26-2010
Can I just add something to this...

I think rsync is the path you have to look down... however, in dealing with Splunk recently for our centralized log management I have found using rsync in a cron is a very very silly idea, especially every minute.

Problem is if you have 2GB of files lets say, every minute rsync connects reads that entire 2GB image from disk and checksums it, if it comes back clear it disconnects else it syncs itself.

Problem is, you are now performing 2GB or reads every single minute.

In our case using splunk recently, 10GB every 5 minutes, which was able to DOS our SAN fairly quickly. (as a result we moved to syslog).

Anyway, thing is, you mentioned you have (some method) running that when something is changed, you are alerted and then you copy over the files. Is this a scripted alert or manual alert (someone emails you)?

If it's scripted, then you can just add an rsync to run rather than alert you.
If it's manual, then make a script to trigger the rsync.

Or perhaps give your users access to a function calling the rsync, ie. a perl cgi page or similar, with a sync it button.

JM2C.
# 7  
Old 07-27-2010
No, the alerts where only emails send by users to me to inform that they've added something, and that I should put that files on the master server. This was the part I wanted to substitute : let something(program) do that notification.
Well, I think I've solved it : pureftp has a mechanism that permits doing some tasks, immediately after a file was uploaded ( pass it to a antivirus, move it to another place, change it's permisions, etc).So , in my case , I will pass the files to my copy-script (the one that puts the files on the master server).
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

FTP log only shows FTP LOGIN FROM entry?

OS: Solaris 9 Configuration /etc/syslog.conf daemon.debug /etc/inetd.conf ftp stream tcp6 nowait root /usr/sbin/in.ftpd in.ftpd -A -l -d Found the ftp.log only generate those entries from other servers/hosts. Can we trace on all ftp entries either from/to the server? ... (6 Replies)
Discussion started by: KhawHL
6 Replies

2. Shell Programming and Scripting

Help with FTP Monitoring Using Perl

Hi, Can anyone help me to start a monitoring script in perl of a FTP server. (2 Replies)
Discussion started by: phanik143
2 Replies

3. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

4. AIX

ftp connect in passive mode , ftp settings

how to connect to ftp server in passive mode? ftp server.abc and how can i see ftp settings, doesn't exist some ftpd.conf there is some other file where i check the options and configurations of ftp server? Thanks (3 Replies)
Discussion started by: prpkrk
3 Replies

5. Shell Programming and Scripting

Automated FTP script using .netrc to multiple FTP servers

Hi all, I'm using the following script to automated ftp files to 1 ftp servers host=192.168.0.1 /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine 192.168.0.1 login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

6. Shell Programming and Scripting

passing parameter to ftp script from output of another ftp

Hi, I have a ftp script which first gets all the file names and echo's the latest file. I'm using another ftp command sets to get the file name given by first ftp. The problem is the parameter is not accepted by second ftp. The error message i'm getting is > Rename Temp File calloc:ICMP... (5 Replies)
Discussion started by: ammu
5 Replies

7. UNIX for Advanced & Expert Users

Using FTP to check whether file is completely FTP... plz find the description below

Hi, We have some clients who will place huge files in to one of the remote server. And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients. My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies

8. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

9. UNIX for Dummies Questions & Answers

Monitoring ftp process

I have an ftp process using vpn, my box is receiving data hit and miss from the host system. Any tool that can be used within unix (ksh) to monitor that ftp process? (2 Replies)
Discussion started by: arkhewit
2 Replies

10. UNIX for Advanced & Expert Users

AFP & FTP Bandwidth Monitoring?

Is there a way to monitor FTP and AFP bandwidth on a per user basis? AFP = AppleFilesharingProtocol, and by monitor, I don't mean graphs, I mean getting raw byte counts I can use in my scripts any way I choose. I am attempting to use mod_watch to monitor virtual domain bandwidth usage, but I really... (0 Replies)
Discussion started by: l008com
0 Replies
Login or Register to Ask a Question