LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-11-2003, 04:57 PM   #1
GuitsBoy
LQ Newbie
 
Registered: Oct 2003
Posts: 26

Rep: Reputation: 15
how do I run a script on FTP disconnect


Hi all -

Im wondering how I can run a script after every FTP disconnect. This way when I upload files to one of my servers (MirrorA) via FTP, I can invoke a script that will rsync / mirror / unison / etc. the files to another server (MirrorB).

I hoped adding a script was as easy as adding a line to the vsftpd file in /etc/xinetd.d but sadly is it not that simple. Anyone have any ideas on how to do this? The xinetd.conf man page did not touch on the subject.

Thanks,
-Tony
 
Old 11-11-2003, 06:04 PM   #2
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
With glFTPd you can define scripts or programs to be executed (with parameters) when the client wants to create a directory, when the clients wants to transfer a file, when a file has been transferred...etc, etc. Lots of useful scripts avaiable too, for everything you can imagine. You can grab the TLS (encryption-enabled) version here and there is also a forum for glFTPd.

Håkan
 
Old 11-12-2003, 10:37 AM   #3
GuitsBoy
LQ Newbie
 
Registered: Oct 2003
Posts: 26

Original Poster
Rep: Reputation: 15
Thanks Håkan.

Does anyone know if it can be done using VSFTP since ive already got alot of virtual domains configured for it and I dont want to change if I dont have to. If not, Ill try glFTPd.

Thanks
-T
 
Old 11-12-2003, 11:47 AM   #4
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
What you *could* do regardless of what FTP daemon you use, is write a little script that checks the existance and change date on the files (or directories), and if they are new - upload/mirror them to that other server. It shouldn't be too hard, and similar scripts should be possible to find to get ideas from or to use straight away. A quick Google turned up this page, which also has a usable script. I don't really know what usability you had in mind so I can't say if it would work for you.

Håkan
 
Old 11-12-2003, 03:00 PM   #5
GuitsBoy
LQ Newbie
 
Registered: Oct 2003
Posts: 26

Original Poster
Rep: Reputation: 15
Thats more or less the way I already have it setup. Im using a third staging server to upload files to. Then on the two live production a cron script invokes rsync to get any changes. The problem is that I dont want it to be time based. Thats why I figured if it was triggered by closing the FTP connection, It would replicate fairly immediately.

Maybe im looking at this the wrong way. Is there anyway to automatically send files over the wire to the other server whenever a file is uploaded or changed? I would guess this would need to be built into the kernel, huh? I dont want it to be run as a cron script. Even minutely cron jobs leaves alot of web hits potentially getting mismatched content.

Thanks again,
-T
 
Old 11-13-2003, 06:15 AM   #6
hw-tph
Senior Member
 
Registered: Sep 2003
Location: Sweden
Distribution: Debian
Posts: 3,032

Rep: Reputation: 58
I don't know. I know I'm really not of any help now but I have zero, *zip* experience of what you speak. I know what you're talking about, but I have never done anything remotely like it myself.

Håkan
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FTP Script will not run from Cron grhansen Programming 12 01-13-2006 05:13 AM
Urgent Help: Perl FTP Script Using NET::FTP xboxter Programming 8 05-16-2005 07:57 PM
pppd doesn't run ip-down on disconnect Ethyriel Slackware 5 03-23-2004 03:37 AM
on Network Up Script run? On Battery power run script? v2-ncl Linux - General 0 12-08-2003 10:34 AM
can't run a script script from icon in konqueror scottsteibel Linux - Software 1 08-02-2003 08:59 PM


All times are GMT -5. The time now is 05:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration