Sponsored Content
Top Forums Shell Programming and Scripting sftp + expect: disconnection & restart removes already transfered data. Post 302472016 by jsmithstl on Tuesday 16th of November 2010 03:28:09 AM
Old 11-16-2010
You don't need to use expect, unless you just want to...
Code:
#!/bin/ksh

set -A A_FILE file1 file2 file3 file4 file5 file6 file7 file8 file9 file10

i=0

while [ -n "${A_FILE[$i]}" ]
do
   sftp -o IdentityFile=${KEYFILE} ${FTPUSER}@${FTPSERVER} <<-EOF
      put ${L_PATH}/${A_FILE[$i]} ${R_PATH}/${A_FILE[$i]}
      quit
   #
   # The EOF must be TABbed over.  It can not be spaces.
   # 
   EOF
   (( i = i + 1 ))
done

As for resuming a broken sftp session. I don't think sftp supports it,
but putty has pfstp and I think it does.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Automating SFTP with Expect

Hello all, I've written an automated SFTP script to work with the Expect command. It recently occurred to me however, that if the client side box does not have the known host entry for the server, it will not work correctly. So I have added an expect for the known host prompt, and that part... (2 Replies)
Discussion started by: sysera
2 Replies

2. Shell Programming and Scripting

expect + cronjob + SFTP

Hi all, i got a really strange problem i wrote a script, when i run this script manually everything works fine but when i make a cronjob for it, with the same user, the EXPECT script will not work. Only the first line will be executed this is the SHell bash script #!/bin/sh; php -q... (2 Replies)
Discussion started by: digitac
2 Replies

3. Shell Programming and Scripting

Help with Expect SFTP script

Hi All, Here is my Expect script, I don't get any error message when I run it. But the file never goes to other system? I also paste the output screen below. When I run the script, the script runs so fast. But when I do it manually, it takes about 10 minutes for the file to transfer. ... (1 Reply)
Discussion started by: samnyc
1 Replies

4. Shell Programming and Scripting

How to automate sftp without using expect script?

How to automate sftp with out using expect script? My batch file has the password but it is not taking. Please see below. I want to use this sftp connection in a loop for pushing new files in a directory one at a time. Hence I can not use an expect script. bash-2.05$... (5 Replies)
Discussion started by: Tuxidow
5 Replies

5. Shell Programming and Scripting

Using expect to automate sftp

I am trying to use a for loop in my expect cmdFile that I am calling. I want to be able to call either one file name or a series of file names in the working directory (that I won't know the names before hand) and then pass the names to the sftp program. Something like for i in (ls *txt) do (0 Replies)
Discussion started by: vedder191
0 Replies

6. Shell Programming and Scripting

Expect Script for SFTP Upload

I am attempting to utilize an expect script (that is called from a parent bash script) to perform a file transfer over sftp. The script works except I cannot catch timeouts. I need to be able to tell in the parent bash script when the expect script has timed out, or completed successfully. It... (3 Replies)
Discussion started by: thaller
3 Replies

7. Shell Programming and Scripting

Problems with expect and sftp in bash

I'm having trouble with some automated sftp pulls. I'm using expect inside bash scripts and spawning SFTP. Some times the expect seems bog down. I have tried to put sleeps in my code to give everything time to work before I move on to next step but I till continue to get issues. For example when... (2 Replies)
Discussion started by: gosteen
2 Replies

8. Shell Programming and Scripting

Unable to do SFTP using expect

Hi, I am trying to sftp using expect, but not getting through as it prompt for password is coming Following is the code #/usr/bin/expect > output.log sftp medcdr@10.130.254.50 expect "password:" send "Med@Cdr12\n" expect "sftp>" send "put ZTE_*201505*\r" expect "sftp>" send "bye\r"... (7 Replies)
Discussion started by: siramitsharma
7 Replies

9. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies
ASxxxx(1)						      General Commands Manual							 ASxxxx(1)

NAME
ASxxxx - Series of microprocessor cross assemblers for SDCC. SYNOPSIS
asx8051 [options] file1 [file2 file3 ... file6] as-gbz80 [options] file1 [file2 file3 ... file6] as-z80 [options] file1 [file2 file3 ... file6] WARNING
The information in this man page is an extract from the full documentation of SDCC, and is limited to the meaning of the options. For complete and current documentation, refer to the ASxxxx Cross Assembler Documentation, available in /usr/share/doc/sdcc-doc/aslink. DESCRIPTION
The ASxxxx assemblers are a series of microprocessor assemblers. Each assembler has a device specific section. MCS51 family is supported by asx8051. Z80family is supported by as-z80. GBZ80 (GameBoy Z80-like CPU) is supported by as-gbz80. OPTIONS
The ASxxxx assemblers are command line oriented. The PC assemblers are started with the appropriate option(s) and file(s) to assemble fol- lowing the assembler name. -d decimal listing. -q octal listing. -x hex listing (default) The listing radix affects the .lst, .rel, and .sym files. -j add line number and debug information to file. -g undefined symbols made global. -a all user symbols made global. -l create list output file1.lst. -o create object output file1.rel. -s create symbol output file1.sym. -p disable listing pagination. -w wide listing format for symbol table. -z enable case sensitivity for symbols. -f flag relocatable references by ` in the listing file. -ff flag relocatable reference by mode in the listing file. The file name for the .lst, .rel, and .sym files is the first file name specified in the command line. All output files are ascii text files which may be edited, copied, etc. The output files are the concatenation of all the input files, if files are to be assembled inde- pendently invoke the assembler for each file. The .rel file contains a radix directive so that the linker will use the proper conversion for this file. Linked files may have different radices. If the list (l) option is specified without the symbol table (s) option, the symbol table is placed at the end of the listing file. SEE ALSO
sdcc(1), aslink(1), asx8051, as-z80(1), as-gbz80(1). AUTHOR
This manual page was written by Aurelien Jarno <aurel32@debian.org>, for the Debian GNU/Linux system (but may be used by others). ASxxxx(1)
All times are GMT -4. The time now is 04:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy