Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can someone point me to the right direction on how i can do the following:
An email notification (say to my blackberry) is sent everytime a specific user has logged into FTP? Or a file uploaded to directory. But it needs to be as close to real time as possible.
Something in the lines of the simple ssh email i get when root logs in.
I. e. you can send a message from a shell script with sendmail. You call it just like any other binary, and it will send an email. This is a logical example, it won't actually work (I can't remember all the parameters right now...!)
I. e. you can send a message from a shell script with sendmail. You call it just like any other binary, and it will send an email. This is a logical example, it won't actually work (I can't remember all the parameters right now...!)
Right, but that's a little hard for someone who just started running linux - Don't get me wrong,I can handle my own and stuff if there's documentation, but if peeps just keep throwing out suggestions I won't be able to learn.
So with that being said, anybody got a link or a sample code so I can look at and adjust?
Ok, I would then suggest first taking a good look at mod_exec (see above) and once you have something there that works, and gets triggered correctly when somebody logs into FTP, only THEN go the distance and start looking into how to get an email out.
If (as I suspect, I know nothing about mod-exec) you eventually get to a point where you can have a script called if somebody logs in, getting a call to sendmail into that script should not be at all difficult.
I'm assuming of course you know what shell scripting is in linux?
I have done something similar, but in PHP - I send email based on a script triggered by cron. Cron is just an application that you can tell "run this each hour" or "run that each day" etc. In my case cron calls a shell script that calls PHP to do daily processes on a database, then emails me if successful.
This might have relevance to your problem since I suspect mod_exec will do the "run this if somebody logs into ftp" bit - the rest you might be able to do similarly...
If you want more info on this, respond and I'll work an explanation up.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.