Sponsored Content
Top Forums Shell Programming and Scripting bash script - sftpbatchfile - stop on failure Post 302618605 by rbatte1 on Wednesday 4th of April 2012 08:41:50 AM
Old 04-04-2012
You could always have the tests and control external. If you have SFTP working, can you also SSH login to the same server as that account? Perhaps a controlling local script could put a single file with SFTP, then an audit and rename could be done by an SSH connection where you can then recognise errors.

Does that idea help?

Robin
Liverpool/Blackburn
UK
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script does not stop when doing a read

Hi Folks, I have been trying to create a script wherein after it reads a certain number of data, it will pause and ask the user if he wants to continue or not. However, it seems that when it is supposed to read the user's answer, the script will go into a loop. What is wrong with my script here?... (7 Replies)
Discussion started by: rooseter
7 Replies

2. UNIX for Dummies Questions & Answers

Stop a shell script

Hi, I am writing a bash shell script. How can I tell it to stop. For example, I would like to have something similar to the following: mike=1 if ; then STOP THE SCRIPT fi (3 Replies)
Discussion started by: msb65
3 Replies

3. Shell Programming and Scripting

script don't stop

Hello everybody! I am new to this and I am trying to change a script in an open source program that plots some offset vectors and then calls a postscript viewer. I have commented away the call for the postscript viewer but somehow the script doesn't return to the shell prompt. I cant figure out... (3 Replies)
Discussion started by: larne
3 Replies

4. UNIX for Dummies Questions & Answers

Anyone know?: How the 'for'-loop could stop working in interactive bash shell?!

It is happening with my sessions already second time: a 'for'-loop for some reason stop to work as expected. That means or it is looping without exitting, or it is not loop even once. Here example of my try when it is not processing even one loop. You can see, I start new subshell and... (14 Replies)
Discussion started by: alex_5161
14 Replies

5. Shell Programming and Scripting

How to stop a script running in remote server from local script

Hi, I have googled for quite some time and couldn't able to get what exactly I am looking for.. My query is "how to stop a shell script which is running inside a remote server, using a script"??? can any one give some suggestions to sort this out. (1 Reply)
Discussion started by: mannepalli
1 Replies

6. Shell Programming and Scripting

Stop child script by stoping parent script

Hi everyone, I have this problem with a script I'm writting. I want to execute a code running in the background several times through a script. I am writting it like that parent_script for a in 1 2 3 4 5 do exec test -n $a done What I want to do is when parent_script is killed,... (0 Replies)
Discussion started by: geovas
0 Replies

7. UNIX for Dummies Questions & Answers

boot up failure unix sco after power failure

hi power went out. next day unix sco wont boot up error code 303. any help appreciated as we are clueless. (11 Replies)
Discussion started by: fredthayer
11 Replies

8. Debian

Bash script to STOP installation 'if' a file exists...

Hey all, Here's my dilemma: 1. I'm a newbie at scripting! 2. I need to create a script that checks: If a file size is equal to zero, then stop the installation. Is there a way to do this or am I wasting my time??? Thanx in advance! :b: (2 Replies)
Discussion started by: thazsar
2 Replies

9. Shell Programming and Scripting

Bash variable assignment failure/unary operator expected

I have a little code block (executing on AIX 7.1) that I cannot understand why the NOTFREE=0 does not appear to be assigned even though it goes through that block. This causes a unary operator issue. #!/bin/bash PLATFORM="AIX" NEEDSPC=3000 set -x if ; then lsvg | grep -v rootvg | while... (6 Replies)
Discussion started by: port43
6 Replies

10. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies
Net::SSH2::SFTP(3pm)					User Contributed Perl Documentation				      Net::SSH2::SFTP(3pm)

NAME
Net::SSH2::SFTP - SSH 2 Secure FTP object DESCRIPTION
An SFTP object is created by the Net::SSH2 "sftp" method. error Returns the last SFTP error (one of the LIBSSH2_FX_* constants). Use this when Net::SSH2::error returns LIBSSH2_ERROR_SFTP_PROTOCOL. In list context, returns (code, error name). open ( file [, flags [, mode ]]] ) Open or create a file on the remote host. The flags are the standard O_RDONLY, O_WRONLY, O_RDWR, O_APPEND, O_CREAT, O_TRUNC, and O_EXCL, which may be combined as usual. Flags default to O_RDONLY and mode to 0666 (create only). Returns a Net::SSH2::File object on success. opendir ( dir ) Open a directory on the remote host; returns a Net::SSH2::Dir object on success. unlink ( file ) Delete the remote file. rename ( old, new [, flags ] ) Rename old to new. Flags are taken from LIBSSH2_SFTP_RENAME_*, and may be combined; the default is to use all (overwrite, atomic, native). mkdir ( path [, mode ] ) Create directory; mode defaults to 0777. rmdir ( path ) Remove directory. stat ( path [, follow ] ) Get file attributes for the given path. If follow is set (default), will follow symbolic links. On success, returns a hash containing the following: mode size uid gid atime mtime setstat ( path, key, value... ) Set file attributes for given path; keys are the same as those returned by stat; note that it's not necessary to pass them all. symlink ( path, target [, type ] ) Create a symbolic link to a given target. readlink ( path ) Return the target of the given link, undef on failure. realpath ( path ) Resolve a filename's path; returns the resolved path, or undef on error. SEE ALSO
Net::SSH2. AUTHOR
David B. Robins, <dbrobins@cpan.org> COPYRIGHT AND LICENSE
Copyright (C) 2005, 2006 by David B. Robins; all rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.0 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2011-05-06 Net::SSH2::SFTP(3pm)
All times are GMT -4. The time now is 08:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy