Sponsored Content
Top Forums Shell Programming and Scripting capturing exceptions from an scp clause Post 302601778 by guessingo on Friday 24th of February 2012 10:52:48 AM
Old 02-24-2012
capturing exceptions from an scp clause

hpunix

I have a script, that will scp -p a file. The server has keys set up. So I don't even pass a username.

scp -p filename server:/directory

There is a small chance that I can get an error. could be networking, etc... this is run from a job. I like to capture all exceptions when I do this.

I can do
if { $? - eq 1 ]; then Log a message.

how would I capture the exception in a scp clause?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

exceptions in import

Hello, I want to import an Oracle database file on my fresh DB, bought before successfully with exp command. But is it possible to import some tables from the dmp file, because they are too large and it's so long !? I didn't find any option in imp command to make exception on certain tables...... (1 Reply)
Discussion started by: madmat
1 Replies

2. UNIX for Dummies Questions & Answers

if clause

hi, pls could you help me with one program in KSH ( i have sunOS). I need to create an If clause, that prints an error message and filenames, when in a directory are found some files of null size (find . -type f -size 0 ). thanks (3 Replies)
Discussion started by: palmer18
3 Replies

3. UNIX for Advanced & Expert Users

Remove directory with exceptions

Hi, I want to remove a directory recursively except the inside directories calles .SYNC (designsync dirs) I am looking for something like: \rm -rf < find . * | grep -v .SYNC The find works ok but I do not know how to redirect it. Please help. Regards, Ziv:rolleyes: (1 Reply)
Discussion started by: zivsegal
1 Replies

4. Shell Programming and Scripting

Remove directory with exceptions

Hi, I want to remove a directory recursively except the inside directories calles .SYNC (designsync dirs) I am looking for something like: \rm -rf < find . * | grep -v .SYNC The find works ok but I do not know how to redirect it. Please help. Regards, Ziv (3 Replies)
Discussion started by: zivsegal
3 Replies

5. UNIX for Advanced & Expert Users

java Exceptions color

Hi, I call a java program from a cron job and i need to display the exceptions or Errors thrown by java(basically stacktrace) in the unix/linux console in the red color.Is it possible to do that? If so, pls. give me some pointers how to do that. eg: Exception in thread "main"... (0 Replies)
Discussion started by: ramse8pc
0 Replies

6. UNIX for Dummies Questions & Answers

Diff with exceptions Question

So I'm currently developing an automated test system and I'm verifying my results by running a set of baselined data through and comparing the output (which is in a txt file) to a baseline results file. So of course I'm just using the diff command. Unfortunately each time I run the test there are 2... (3 Replies)
Discussion started by: Smitty0881
3 Replies

7. Programming

Relationship between exceptions and signals

Hi everyone, I am using AIX 6.1. There are exception codes defined in header file sys/m_except.hAlso, in the documentation (in "Understanding exception handling") it says: If no exception handler is currently defined when an exception occurs, typically one of two things happens. If... (0 Replies)
Discussion started by: manolo123
0 Replies

8. IP Networking

SIGUP Exceptions during the execution

hello, I am getting SIGUP Exceptions during an execution of a procedure. Below is the log: Type: SignalException Message: SIGHUP Backtrace: 12:38 PM Action threw an exception: SIGHUP 12:38 PM Action threw an exception: SIGHUP E, ERROR -- : Type: SignalException Message: SIGHUP... (1 Reply)
Discussion started by: Deepthi.Prakash
1 Replies

9. Shell Programming and Scripting

Wildcards and exceptions

Hello: I have a very basic question. I'd like to select all files except for one file. For example, say I want to move all of the files in my current directory to a subdirectory called archive, I would use mv ./* archive/ But what if I want to move all files except for README.txt? Is there an... (19 Replies)
Discussion started by: Danny.Boy
19 Replies

10. Shell Programming and Scripting

RegEx with exceptions

I am totaly new to RegEx, but I need to extract emails with RegEx from text file Some difficulties: 1. “@”symbol has been substituted for “ at ”,"AT" or "(at)" 2. I do not need any email with domain "myoldcompany" I found that with these I can found any emails: "^+@+\.+$" How to do... (1 Reply)
Discussion started by: AIX_30
1 Replies
BACKUP-MANAGER-UPLOAD(8)				       backup-manager-upload					  BACKUP-MANAGER-UPLOAD(8)

NAME
backup-manager-upload - Multiprotocol uploader for backup-manager. SYNOPSIS
backup-manager-upload [options] date DESCRIPTION
backup-manager-upload will upload all the archives generated on the given date to the specified host with either ftp or scp. It's also possible to use this program for uploading data to an Amazon S3 account. Some metadates are available like "today" or "yesterday". REQUIRED ARGS
--mode=transfer-mode Select the transfer mode to use : ftp, scp, or s3. --host=hostname1,hostname2,...,hostnameN Select a list of remote hosts to connect to. --user=username Select the user to use for connection. OPTIONAL ARGS
--password=password Select the ftp user's password (only needed for ftp transfers). --key=path_to_private_key Select the ssh private key file to use when opening the ssh session for scp transfer. Obviously, this is only needed for scp transfer mode. If you don't specify a key file, the user's default private key will be used. --directory=directory Select the location on the remote host where files will be uploaded. Default is /backup/uploads. --bucket=bucket Sets the bucket name for the Amazon S3 service backup into. --root=directory Select the local directory where files are. Default is /var/archives --gpg-recipient=gpg-recipient Select the gpg public key for encryptiong the archives when uploading with the method ssh-gpg. This can be a short or long key id or a descriptive name. The precise syntax is described in the gpg man page. --list Just list the files to upload. --ftp-purge Purge the remote directory before uploading files in FTP mode. --s3-purge Purge the remote directory before uploading files in FTP mode. --ssh-purge Purge the remote directory before uploading files in SSH mode. --verbose Flag to enable verbose mode. date Date pattern to select some files to upload, can be a valid date (YYYYMMDD) or 'today' or 'yesterday'. ERROR CODES
If something goes wrong during an upload, backup-manager-upload will exit with a non null value. In such a case every error messages are sent to STDERR. Here are the possible error codes: bad command line (wrong arguments) : 10 FTP transfer failure : 20 SCP transfer failure : 21 S3 transfer failure : 22 Unknown upload method: 23 SEE ALSO
backup-manager(3) AUTHORS
Alexis Sukrieh - main code and design Brad Dixon - Amazon S3 upload method Jan Metzger - ssh-gpg upload method perl v5.14.2 2012-05-09 BACKUP-MANAGER-UPLOAD(8)
All times are GMT -4. The time now is 10:25 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy