This is a discussion on Require Shell Script Which sends all server info on mail within the Linux software forums, part of the Linux Getting Started category; Dear All. I require a shell script for Linux, which sends me a all logs file ,space available on server ...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Dear All.
I require a shell script for Linux, which sends me a all logs file ,space available on server and when server is rebooted in particular time interval. So all the information I want on my mail. This problem is that my Linux server does not have public ip so it should forward mail to particular MTA. Basically I want all the server information on my mail in every 1 hour time. Is there any way I can do it, Pls help me.
__________________
someone somewhere is made for you. LOVE is Journey not a destination. ALL I want is EVERYTHING. |
|
||||
|
There is a program called nbsmtp. It allows to specify which MTA you would like to use.
Download and compile program http://nbsmtp.ferdyx.org/ Code:
cat /tmp/mail.txt | ./nbsmtp -f you@yourdot.com -h remote.relay.email.server.com -p 25 -u smtp-user -p smtp-passwd -M 1 Code:
./nbsmtp -f you@yourdot.com -h remote.relay.email.server.com -p 25 -u smtp-user -p smtp-passwd -M 1 < /tmp/mail.txt |
|
|||
|
Dear Monk.
Thanks for your reply, I do not know whether u have understand my point or not. Simplt what I want is all server logs and how much space available on server, shoud automatically come on my mail. I have another server which works as MTA it just sends a mail to internet cloud. So I want is my limus server send a mail to this server with all info and this server forward a mail to any mail ID may be Yahoo or Gmail. Waiting for your reply. Regards.
__________________
someone somewhere is made for you. LOVE is Journey not a destination. ALL I want is EVERYTHING. |
|
||||
|
Use mail command to send email
Code:
mail -s "subject" me@yahoo.com < log.file.txt Code:
mutt -s "subect" -a /var/log/mail.log me@yahoo.com < /dev/null What monk told is quite advance and it is only recommended if you need to authenticate SSL mail or in chrooted jail. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Tomcat shell script cron job to restart server | kasimani | Shell scripting | 4 | 05-03-2008 07:46 PM |
| shell script to send mail for each login. | ephdia | Shell scripting | 2 | 11-27-2007 04:42 PM |
| bash script to collect info | adahan | Shell scripting | 7 | 10-31-2007 06:06 PM |
| Require shell script using rsync | puppen | Shell scripting | 4 | 04-23-2006 12:52 AM |
| require shell script | puppen | Shell scripting | 4 | 04-12-2006 09:42 PM |