Sponsored Content
Full Discussion: Log and Mail problem
Top Forums UNIX for Dummies Questions & Answers Log and Mail problem Post 302173312 by chris1234 on Thursday 6th of March 2008 09:17:27 AM
Old 03-06-2008
Thanks praveenvi. I do not get the error now. I have to test it to see if that mail functionality works or not. But its very wiered that this same mail function i used for my other program and never had a problem but when i used in this script it give me error.

One more question so right now my if statement looks like this :-

Code:
 if [ $? != 0 ]; then
    echo "Error occured"
     mailx -s \ "File Transfer Failed" \ "abc@xyz.com"
    scp failed from SUPRA to FERRARI
   `date`
    echo "File Transferred failed from SUPRA to FERRARI `date +%n%m/%d/%Y%n%H:%M:%S`" >>$LOCAL_LOG_FILE 2>&1

My question is that is :-

scp failed from SUPRA to FERRARI
`date`

will be added in the description of the mail or not?

Thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Problem with mail

what I have to write in a shell that every time that it arrives a new e-mail has to perform a program taking some data from the e-mail. (2 Replies)
Discussion started by: mmistero
2 Replies

2. UNIX for Dummies Questions & Answers

E-mail problem

Is it true that you need port 110(POP3) to be open for sending email out ?? I can send email out fine but when I check my port 110 is not open. The problem I have is that I can not receive email at all or can not send email locally (between my users). Here is what I get using the netstat... (6 Replies)
Discussion started by: guest100
6 Replies

3. UNIX for Advanced & Expert Users

mail problem !!

Hi, Below a try to send an email to a local user can be seen. I can NOT send e-mail anywhere, but I receive email perfectly. <pre> isgsi01(root)10: mail aris < /home/aris/mail2send dbm map "Alias0": unsafe map file /etc/mail/aliases: No such file or directory </pre> ..... but the... (3 Replies)
Discussion started by: guest100
3 Replies

4. UNIX for Dummies Questions & Answers

mail problem (NOT Mail or Mail.app)

When I try to use the CLI mail, I get the following error. What's wrong? Welcome to Darwin! % mail root Subject: test test . EOT % /etc/mail/sendmail.cf: line 81: fileclass: cannot open /etc/mail/local-host-names: Group writable directory Do I just need to change the... (1 Reply)
Discussion started by: chenly
1 Replies

5. UNIX for Dummies Questions & Answers

Problem with mail

Hello! I have to servers with Solaris 2.7. I mail from first to second ( mailx user@dev < letter ). But mail not arrive to second. It return by daemon with explanation: .... --- Transcript of session follows --- 550 5.1.2 user@dev... Host unknown (Name server: mailhost.serv.dom: host not... (2 Replies)
Discussion started by: Colf
2 Replies

6. UNIX for Dummies Questions & Answers

Problem with mail.

Hello! I have two servers with Solaris 2.7 I send mail from first to second. The first is also dns. It's known as "ns.oldb.pkb", second is "dev.pkb". Ping works successful from 1 to 2 and vice verse. But when I am trying on first server : sendmail -v user@dev.pkb < /etc/motd it is... (3 Replies)
Discussion started by: Colf
3 Replies

7. Red Hat

Mail Problem. Maybe, it is a DNS Problem!

Hi, i've a redhat linux 9 upadated by redhat from 7 version to 9 version. A couple of days ago i was a problem with my mail, in other words i'm not able to get any email nor to send any email. I've a proxy configuration and i tried to set iptables in order to verify the port. The 110,255 and 995... (1 Reply)
Discussion started by: pintalgi
1 Replies

8. UNIX for Advanced & Expert Users

HP UX mail problem

I am uxing HP UX mailx, I want to send mail with: 1) to list 2) cc list 3) sender address 4) mail body 5) subject 6) attachment I am using : (cat cc_list; cat mail_body; ux2dos file_1 | uuencode attachment.txt)|mailx -m -s "subject" -r sender@abc.com recepient@abc.com cc_list... (2 Replies)
Discussion started by: gautamadak
2 Replies

9. UNIX for Dummies Questions & Answers

Mail Problem

Hi All, I am having a problem that is very similar to the one being discussed here. I am using OS X and am trying to send mail from the OS X Terminal to my GMail account. The mail seems to go through, but gets stuck at Google's servers. I have a log file from the /var/mail directory that... (0 Replies)
Discussion started by: danielsutton
0 Replies

10. Shell Programming and Scripting

Log search and mail it if the log is updated before 24 hours from the current time

Hi , We have around 22 logs , each has different entries. I have to automate this using shell script. The ideas which am sharing is given below 1) We use only TAIL -100 <location and name of the log> Command to check the logs. 2) We want to check whether the log was updated before 24... (13 Replies)
Discussion started by: Kalaihari
13 Replies
DATETIME.SUB(3) 							 1							   DATETIME.SUB(3)

DateTime::sub - Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object

       Object oriented style

SYNOPSIS
public DateTime DateTime::sub (DateInterval $interval) DESCRIPTION
Procedural style DateTime date_sub (DateTime $object, DateInterval $interval) Subtracts the specified DateInterval object from the specified DateTime object. PARAMETERS
o $object -Procedural style only: A DateTime object returned by date_create(3). The function modifies this object. o $interval - A DateInterval object RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure. EXAMPLES
Example #1 DateTime.sub(3) example Object oriented style <?php $date = new DateTime('2000-01-20'); $date->sub(new DateInterval('P10D')); echo $date->format('Y-m-d') . " "; ?> Procedural style <?php $date = date_create('2000-01-20'); date_sub($date, date_interval_create_from_date_string('10 days')); echo date_format($date, 'Y-m-d'); ?> The above examples will output: 2000-01-10 Example #2 Further DateTime.sub(3) examples <?php $date = new DateTime('2000-01-20'); $date->sub(new DateInterval('PT10H30S')); echo $date->format('Y-m-d H:i:s') . " "; $date = new DateTime('2000-01-20'); $date->sub(new DateInterval('P7Y5M4DT4H3M2S')); echo $date->format('Y-m-d H:i:s') . " "; ?> The above example will output: 2000-01-19 13:59:30 1992-08-15 19:56:58 Example #3 Beware when subtracting months <?php $date = new DateTime('2001-04-30'); $interval = new DateInterval('P1M'); $date->sub($interval); echo $date->format('Y-m-d') . " "; $date->sub($interval); echo $date->format('Y-m-d') . " "; ?> The above example will output: 2001-03-30 2001-03-02 NOTES
DateTime.modify(3) is an alternative when using PHP 5.2. SEE ALSO
DateTime.add(3), DateTime.diff(3), DateTime.modify(3). PHP Documentation Group DATETIME.SUB(3)
All times are GMT -4. The time now is 06:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy