Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Confirm the execution of copy command is successful or not Post 302924784 by Corona688 on Wednesday 12th of November 2014 10:59:43 AM
Old 11-12-2014
Providing nothing else caught any exceptions inside it, yes.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

command execution ??

hi i have small shell script as follows cd /utilities/promoter/tmp grep SENDREPLY $1 | grep 'zzzzz@zzz.com' | awk -F" -f1 > /tmp/$LOGNAME/$1.request cd /tmp/$LOGNAME grep -e "\.sql" -e "\.md" $1.request > upd_$1.txt grep -v -e "\.sql" -e "\.md" $1.request > copy_$1.txt ... (1 Reply)
Discussion started by: zedex
1 Replies

2. UNIX for Dummies Questions & Answers

Test if execution was successful

Hi How can I test inside a shel script whether the last action was successful or not. I have the following line which is executing inside a script . ./runProcess.sh $i $var_num>> error.txt 2>&1 This is occuring in a loop. How can i test whether it was succes for last var_num or not. How... (2 Replies)
Discussion started by: Prashantckc
2 Replies

3. UNIX for Dummies Questions & Answers

Confirm job execution

Hello everybody, Can anybody tell me how do we comfirm the execution of a scheduled job ? In other words, how do I know whether my scheduled script is being executed or not ? Thanks Jitu JK (2 Replies)
Discussion started by: jitu.jk
2 Replies

4. Shell Programming and Scripting

Confirm file copy

Need to check whether the source file(FTP'ed file) is completly copied or not such that I can further action on the same. I have created the below script to achieve this by checking for every 10secs to whether file size is same or not but it may create a problem if the file transfer is slow and if... (4 Replies)
Discussion started by: palanisvr
4 Replies

5. Shell Programming and Scripting

Want to terminate command execution when string found in the command output

Hi Experts, I am very much new to linux scripting, I am currently working on reducing my manual work and hence writing a script to automate few task. I am running below command to snmpwalk the router.. snmpwalk -v 3 -u WANDL_SU -a MD5 -A vfipmpls -x DES -X VfIpMpLs -l authPriv... (19 Replies)
Discussion started by: Hanumant.madane
19 Replies

6. Shell Programming and Scripting

Compare File & Copy Replace if Successful

Hi All, I have written a shell script that creates a backup of my MySQL database. The script performs the following functions: Creates a Backup of the MySQL database Compresses the Backup Copies the Backup to a Remote Server Send an E-Mail displaying the size of the Backup Removes any... (6 Replies)
Discussion started by: SalientAnimal
6 Replies

7. Shell Programming and Scripting

Multiple command execution inside awk command during xml parsing

below is the output xml string from some other command and i will be parsing it using awk cat /tmp/alerts.xml <Alert id="10102" name="APP-DS-ds_ha-140018-componentFailure-S" alertDefinitionId="13982" resourceId="11427" ctime="1359453507621" fixed="false" reason="If Event/Log Level(ANY) and... (2 Replies)
Discussion started by: vivek d r
2 Replies

8. Shell Programming and Scripting

Need to echo command successful if command is executed successfully

Hello, I have written a command n shell script : srvctl relocate service -d t1 -s s1 -i i1 -t t1 -f If the above command executes successfully without error I need to echo "Service relocated successfully and If it errors out I need to trap the errors in a file and also need to make... (1 Reply)
Discussion started by: Vishal_dba
1 Replies

9. UNIX for Dummies Questions & Answers

Confirm the execution of Copy command is successfull or not

All, I have to copy huge file from one location to another using python . I want to make sure the execution of Copy command is successful and all the files are copied properly (there has not been any abrupt interruption to the copy process or error like no space available is encountered during... (2 Replies)
Discussion started by: IshuGupta
2 Replies

10. Red Hat

Systemd booting and execute system command is Not successful!help!

hi guys, booting centos7 and use systemd execute system command ulimit -SHn 202400 is fail.i dont know what's reason.can you give me help. ------------------------------------------ set-ulimit.service Description=test service After=systemd-update-utmp-runlevel.service #the last... (1 Reply)
Discussion started by: shean
1 Replies
Dancer::Exception(3pm)					User Contributed Perl Documentation				    Dancer::Exception(3pm)

NAME
Dancer::Exception - class for throwing and catching exceptions SYNOPSIS
use Dancer::Exception qw(:all); register_exception('DataProblem', message_pattern => "test message : %s" ); sub do_stuff { raise DataProblem => "we've lost data!"; } try { do_stuff() } catch { # an exception was thrown my ($exception) = @_; if ($exception->does('DataProblem')) { # handle the data problem my $message = $exception->message(); } else { $exception->rethrow } }; DESCRIPTION
Dancer::Exception is based on Try::Tiny. You can try and catch exceptions, like in Try::Tiny. Exceptions are objects, from subclasses of Dancer::Exception::Base. However, for internal Dancer usage, we introduce a special class of exceptions, called Dancer::Continuation. Exceptions that are from this class are not caught with a "catch" block, but only with a "continuation". That's a cheap way to implement a workflow interruption. Dancer users should ignore this feature. What it means for Dancer users Users can throw and catch exceptions, using "try" and "catch". They can reuse some Dancer core exceptions ("Dancer::Exception::Base::*"), but they can also create new exception classes, and use them for their own means. That way it's easy to use custom exceptions in a Dancer application. Have a look at "register_exception", "raise", and the methods in Dancer::Exception::Base. METHODS
try Same as in Try::Tiny catch Same as in Try::Tiny. The exception can be retrieved as the first parameter: try { ... } catch { my ($exception) = @_; }; continuation To be used by Dancer developers only, in Dancer core code. raise # raise Dancer::Exception::Base::Custom raise Custom => "user $username is unknown"; # raise Dancer::Exception::Base::Custom::Frontend raise 'Custom::Frontend' => "user $username is unknown"; # same, raise Dancer::Exception::Base::Custom::Frontend raise custom_frontend => "user $username is unknown"; # raise My::Own::ExceptionSystem::Invalid::Login raise '+My::Own::ExceptionSystem::Invalid::Login' => "user $username is unknown"; raise provides an easy way to throw an exception. First parameter is the name of the exception class, without the "Dancer::Exception::" prefix. other parameters are stored as raising arguments in the exception. Usually the parameters is an exception message, but it's left to the exception class implementation. If the exception class name starts with a "+", then the "Dancer::Exception::" won't be added. This allows one to build their own exception class hierarchy, but you should first look at "register_exception" before implementing your own class hierarchy. If you really wish to build your own exception class hierarchy, we recommend that all exceptions inherit of Dancer::Exception::. Or at least it should implement its methods. The exception class can also be written as words separated by underscores, it'll be camelized automatically. So 'Exception::Foo' and 'exception_foo' are equivalent. Be careful, 'MyException' can't be written 'myexception', as it would be camelized into 'Myexception'. register_exception This method allows one to register custom exceptions, usable by Dancer users in their route code (actually pretty much everywhere). # simple exception register_exception ('InvalidCredentials', message_pattern => "invalid credentials : %s", ); This registers a new custom exception. To use it, do: raise InvalidCredentials => "user Herbert not found"; The exception message can be retrieved with the "$exception-"message> method, and we'll be "invalid credentials : user Herbert not found" (see methods in Dancer::Exception::Base) # complex exception register_exception ('InvalidLogin', composed_from => [qw(Fatal InvalidCredentials)], message_pattern => "wrong login or password", ); In this example, the "InvalidLogin" is built as a composition of the "Fatal" and "InvalidCredentials" exceptions. See the "does" method in Dancer::Exception::Base. registered_exceptions my @exception_classes = registered_exceptions; Returns the list of exception class names. It will list core exceptions "and" custom exceptions (except the one you've registered with a leading "+", see "register_exception"). The list is sorted. GLOBAL VARIABLE
$Dancer::Exception::Verbose When set to 1, exceptions will stringify with a long stack trace. This variable is similar to $Carp::Verbose. I recommend you use it like that: local $Dancer::Exception::Verbose; $Dancer::Exception::Verbose = 1; All the Carp global variables can also be used to alter the stacktrace generation. perl v5.14.2 2012-03-31 Dancer::Exception(3pm)
All times are GMT -4. The time now is 03:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy