I want to do something and I can't figure out. The idea is that a script should send an email when a backup is done.
It works with a unix account (like root) but what I really want is to send that email to other account like fede@somethig.com.
I have a mail server installed in other computer, all these boxes are running solaris 9.
I believe that I should tell the box that is running the backup script to send the email using other mail server, but I don't know how to do it.
Also, as a test, I tried: mail -t myaccount@stuff.com, and it doesn�t work. (of course the email acount exist...)
So if someone can help me, I'll send a pack of six beers...
it really depends on how your doing the backup in the first place.
for me. i run my backups via cron and i have the output goto the cronusers email. you can always pipe the output to the mail command and then you can specify which user.
some backup software allows you to configure users to be notified when an event happens. so i would check your software docs and see what you can come up with, or talk with the people that manage the backups and set it up in the first place they would prolly have the most valuable information for you.
# and when the copy is done I want to be informed by mail
# but not to my unix account like root, I want the mail to, for # example, myaccount@hotmail.com.
You can create a shell script and test to see if it executes without error. If it executes without error, then you can email a success message; if with error, you can email an error message.
Ok, now it works. Because the os is Solaris I use the mailx, as you mention. At first it doesn�t work, the I wento to my /etc/mail/sendmail.cf and I added "DSmymailserver."
With this line worked, the mail is forwarder to my mail server.
Fine.
Rightly or wrongly, a lot of people are intimidated by the effort of downloading source code and building a package. That's why precompiled freeware is important. Sun distributes elm... see this link.
A HP engineer wrote elm for fun and HP accepted it as part of HP-UX. But elm was released as freeware and has been enhanced. So even though elm comes standard with HP-UX, it is an older version. The standard HP-UX elm is a nice program, but you might want to consider a newer version. One newer elm precomplied for HP-UX is available here.