Sponsored Content
Top Forums Shell Programming and Scripting How to deliver an error message from script? Post 302918395 by Makarand Dodmis on Tuesday 23rd of September 2014 06:01:06 AM
Old 09-23-2014
check what is exit status of ftp command using echo $?....
then using if condition send the mail to user..something like below
Code:
if [ $? -eq <o/p of above echo> ] # exit status is not 0
  then
    echo "No space left on device" | mailx -s "Error:No Space" email@mycomp.com
else
    echo "File transfered SUCCESSFULLY at $(date)."
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

problem with script and syntax error message

Hi I have the following script and have problem debugging the problems. The function of this script is to make sure the entire file is being received (the filesize of a data is not changing after 20 seconds) and start moving the file to another directory. This script should be started every 30mins.... (5 Replies)
Discussion started by: ReV
5 Replies

2. Shell Programming and Scripting

Error message while executing the shell script

Hi All, When I am trying to execute the below shell script I got this error message. script ========== #!/bin/bash /usr/java/jdk1.5.0_10/bin/java - classpath /var/lib/asterisk/agi-bin/mysql-connector-java-3.0.15-ga-bin.jar/: /var/lib/asterisk/agi-bin/jarfiles:... (4 Replies)
Discussion started by: ajayyaduwanshi
4 Replies

3. Shell Programming and Scripting

Suppress error message in shell script

Hi All this is a simple script #! /bin/bash FileCnt=`ls -lrt $DIR/* | wc -l` echo $FileCnt how could i escape the error msg if there are no files in $DIR ls: /home/sayantan/test/files/cnt/*: No such file or directory 0 Looking forward for a quick reply Regards, Newbie... (3 Replies)
Discussion started by: newbie07
3 Replies

4. Shell Programming and Scripting

Nightly job error message when trying to execute script

Hello All, I am getting the following error message when trying to execute the following script. AWK=/usr/bin/awk TR=/usr/bin/tr SED=/usr/bin/sed CAT=/usr/bin/cat MAILFILE=/home//nightly_jobs.tmp mailto=xxx@gmail.com Nigh_Status = `db2 "select TYPE from ETL.LOCK where STATUS <> 0 and... (12 Replies)
Discussion started by: NARESH1302
12 Replies

5. Shell Programming and Scripting

Self referencing script error message

Hello again all. I have a user editable script that I'd like to have point out the user error to. Problem is I'm having troubles getting an echoed error message to give me the line. Here's what I'm trying to do. grep -n $loc /this/script.sh where '$loc' is the argument passed to the script.... (9 Replies)
Discussion started by: DC Slick
9 Replies

6. UNIX for Advanced & Expert Users

Sendmail Script don't deliver mails

Hi, i've got a problem with a sendmail script, which sends HTML mails. Some mail will rejected by the mail server, because the fqdn doesn't exist. Where can i set the sender-domainname by sendmail? My mail server say: "Sender address rejected: Domain not found;", which is correct... (3 Replies)
Discussion started by: rainbowwarrior
3 Replies

7. Shell Programming and Scripting

Script returning an error message on exiting

Hi, I am writing a script in which I am using an IF-Else statement. Code sample: # Check for the product. If (test "$3" = "Pet") Then Product_Code="PI" elif (test "$3" = "Breakdown") Then Product_Code="RI" elif (test "$3" = "Travel") Then Product_Code="TI" ... (2 Replies)
Discussion started by: bghosh
2 Replies

8. Shell Programming and Scripting

Passing error message back to script

I have one script that calls another script during execution. The other script does some processing, then either returns with exit 0 (if successful), or exits with error code numbers (if failed). However, in addition to the error code, I would like for that second script to be able to pass a... (4 Replies)
Discussion started by: AcerAspirant
4 Replies

9. UNIX for Beginners Questions & Answers

UNIX script error message

Greeting!! I wrote the below script to e-mail me only file names in a specific directory when a file is delayed for some time in a that directory. I am getting unexpected eof error message. I don't want any email if the folder is blank.(if the condition is not met) I am not getting the email at... (4 Replies)
Discussion started by: Hope
4 Replies

10. UNIX for Beginners Questions & Answers

UNIX script error message

I have this UNIX script code with a query to export sql table in Oracle and export to csv file. The code gets the data correctly. However, when I run the script second time, I got the error message "not spooling currently" and shows the older data in csv file. When I delete the csv file and run... (5 Replies)
Discussion started by: Hope
5 Replies
IMAP_MAILBOXMSGINFO(3)							 1						    IMAP_MAILBOXMSGINFO(3)

imap_mailboxmsginfo - Get information about the current mailbox

SYNOPSIS
object imap_mailboxmsginfo (resource $imap_stream) DESCRIPTION
Checks the current mailbox status on the server. It is similar to imap_status(3), but will additionally sum up the size of all messages in the mailbox, which will take some additional time to execute. PARAMETERS
o $ imap_stream -An IMAP stream returned by imap_open(3). RETURN VALUES
Returns the information in an object with following properties: Mailbox properties +--------+----------------------------------------+ | Date | | | | | | | date of last change (current datetime) | | | | |Driver | | | | | | | driver | | | | |Mailbox | | | | | | | name of the mailbox | | | | | Nmsgs | | | | | | | number of messages | | | | |Recent | | | | | | | number of recent messages | | | | |Unread | | | | | | | number of unread messages | | | | |Deleted | | | | | | | number of deleted messages | | | | | Size | | | | | | | mailbox size | | | | +--------+----------------------------------------+ Returns FALSE on failure. EXAMPLES
Example #1 imap_mailboxmsginfo(3) example <?php $mbox = imap_open("{imap.example.org}INBOX", "username", "password") or die("can't connect: " . imap_last_error()); $check = imap_mailboxmsginfo($mbox); if ($check) { echo "Date: " . $check->Date . "<br /> " ; echo "Driver: " . $check->Driver . "<br /> " ; echo "Mailbox: " . $check->Mailbox . "<br /> " ; echo "Messages: " . $check->Nmsgs . "<br /> " ; echo "Recent: " . $check->Recent . "<br /> " ; echo "Unread: " . $check->Unread . "<br /> " ; echo "Deleted: " . $check->Deleted . "<br /> " ; echo "Size: " . $check->Size . "<br /> " ; } else { echo "imap_mailboxmsginfo() failed: " . imap_last_error() . "<br /> "; } imap_close($mbox); ?> PHP Documentation Group IMAP_MAILBOXMSGINFO(3)
All times are GMT -4. The time now is 07:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy