Hi
I am executing database backup via shell script (Korn). The backup log is long, but I would like to capture only the last line so I can send an email if it fails
Example of failed backup (only last 3 lines)
Example of successful backup (only last 3 lines)
How do I do that?
Last edited by Scott; 07-31-2012 at 09:17 AM..
Reason: Code tags
I try to test the carriage return in a variable.
$ LENGTH=`expr $VARIABLE : ".*"` will return the length of the variable. But this doesn't work if $VARIABLE has zero length.
Any help will be well appreciated.
Thanks in advance.
Giovanni (4 Replies)
I am using the following code in my shell script
list=`sqlplus -s $user/$pwd@$dbms<<EOF
WHENEVER SQLERROR EXIT SQL.SQLCODE
set pagesize 0 feedback off verify off heading off echo off
select * from control_tbl
where src_nm=$3
and extrct_nm=$4;
exit SQL.SQLCODE;
EOF`
ERROR=$?... (1 Reply)
Hi,
Here is my program that is returning a DATE:
#! /usr/bin/ksh
db=tcore_dev1
bteq <<end
.logon $password_core
.export report file=$BTEQ_OUTPUT_FILE_$$
select cast(add_months(cast(substr(cast(max(closedate) as varchar(10)),1,8)||'01' as Date),1)-1 as timestamp(0)) from $db.repo... (2 Replies)
Hi all,
i have written a code to ftp a file from one server to other.The ftp is happeneing successfully,but i am not able to capture the return code,to check if ftp has failed.
plz help me to find out the return code....this is urgent
below is the code i have written... (3 Replies)
I have a process that copies files from a main storage server to main other servers. We are attempting to speed up the processing and have thought that the best method would be to use concurrent file copying.
What was suggested is that we change from using a simple RCP and waiting for it to... (3 Replies)
I have a K shell script (ksh) that needs to return an email address. A C program was written (prog1) to now access the email address off of an oracle table. The call to the program in the ksh is
prog1 -p parm1
Based on Parm1 the program will read an oracle table and retrieve the email... (2 Replies)
Hi,
I would like to compare 2 files, and have a return code write to a file.
regardless of the files contents are the same the code should be writing to a file (if both files contents are same then return code 0).
A simple example will be great :)
Thanks (3 Replies)
hi,
i want to pop up an alert box using perl script. my requirement is.
i am using a html page which calls a perl script. this perl script calls a shell script.. after the shell script ends its execution, i am using exit 0 to terminate the shell script successfully and exit 1 to terminate the... (3 Replies)
is it possible to capture the 3 digit return code of ftp commands in a local variable inside a shell script?
Code:
ftp remoteserver << EOFTP
quote USER uid
quote PASS pass
prompt
cd remote_directory
mput file.txt
bye
EOFTP
in the above script, if cd ... (4 Replies)
Discussion started by: Little
4 Replies
LEARN ABOUT OSF1
backup_help
BACKUP_HELP(8) AFS Command Reference BACKUP_HELP(8)NAME
backup_help - Displays help for backup commands
SYNOPSIS
backup help [-topic <help string>+] [-admin] [-help]
backup h [-t <help string>+] [-a] [-h]
DESCRIPTION
The backup help command displays the complete online help entry (short description and syntax statement) for each operation code specified
by the -topic argument. If the -topic argument is omitted, the output includes the first line (name and short description) of the online
help entry for every backup command.
To list every backup command whose name or short description includes a specified keyword, use the backup apropos command.
OPTIONS -topic <help string>+
Indicates each command for which to display the complete online help entry. Omit the backup part of the command name, providing only
the operation code (for example, specify dump, not backup dump). If this argument is omitted, the output briefly describes every backup
command.
-help
Prints the online help for this command. All other valid options are ignored.
OUTPUT
The online help entry for each backup command consists of the following two or three lines:
o The first line names the command and briefly describes its function.
o The second line lists aliases for the command, if any.
o The final line, which begins with the string "Usage", lists the command's options in the prescribed order. Online help entries use the
same symbols (for example, brackets) as the reference pages in this document.
EXAMPLES
The following example displays the online help entry for the backup dump command:
% backup help dump
backup dump: start dump
Usage: backup dump -volumeset <volume set name> -dump <dump level name>
[-portoffset <TC port offset>] [-at <Date/time to start dump>+]
[-append] [-n] [-file <load file>] [-help]
PRIVILEGE REQUIRED
None
SEE ALSO backup(8), backup_apropos(8)COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2012-03-26 BACKUP_HELP(8)