Using expect to automate sftp

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using expect to automate sftp
# 1  
Old 06-14-2011
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)

Last edited by pludi; 06-14-2011 at 05:20 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to automate sftp and always get the latest file

hi guys the script is working but i need to change the file that i want to get to the latest.. i will use this as cron so i can get the latest sftp file evryday. pls help.. set user "big_user" set IP "XX.XX.XX" set dir "/export/home/oracle/REF/INPUT" spawn sftp $user@$IP expect sftp> ... (7 Replies)
Discussion started by: JONATHAN0919
7 Replies

2. Shell Programming and Scripting

Sftp automate

hi, I am trying to automate a file download process using sftp. There is some logic to download files. 1) I need to login to destination server and then go to folder. 2) find list of files and count 3) using list of files I need to eliminate three selective files and download remaining... (1 Reply)
Discussion started by: getmilo
1 Replies

3. UNIX for Dummies Questions & Answers

Automate sftp process using script

Hi, guys, I am trying to automate a sftp process using "expect" method (since the key authentication method is disabled in my company network, there is no helping it). In order to try, I type in the command manually: sftp @ > << EOF >cd >ls -l >EOF >Connecting to @servername password: ... (3 Replies)
Discussion started by: warmboy610
3 Replies

4. UNIX for Dummies Questions & Answers

automate sftp in sun solaris.

Hi, I'm using Sun Solaris OS. I have configured sftp and can exchange files in command prompt. Now when I try to automate it in ksh script, facing issue as I want to capture the status if the transfer was successful or not. So tried sftp -b and sftp -B option but its not working. The... (3 Replies)
Discussion started by: shinny
3 Replies

5. Shell Programming and Scripting

Expect script to automate telnet session

Hi all, I am currently running a daemon which creates a virtual terminal for testing purposes. Essentially, if I were to interact with it manually, this is what I get. john@test1:~$telnet localhost 7777 Trying ::1... Connected to localhost. Escape character is '^]' mip6d> pl eth2... (6 Replies)
Discussion started by: abxccd
6 Replies

6. Shell Programming and Scripting

Expect Script to Automate SSH

How would I write an expect script to automate ssh and what file extention do expect files use? (11 Replies)
Discussion started by: Prodiga1
11 Replies

7. 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

8. Shell Programming and Scripting

automate sftp using unix script

Hi All, I need to write a UNIX script that automates the sftp process. I should be able to do a sftp to a secure box and get a file from there. I am having a problem doing this because no matter what I do, when I run my script, I get a prompt at command line asking for a password. How could I... (34 Replies)
Discussion started by: priyamurthy2005
34 Replies

9. Shell Programming and Scripting

Automate SFTP is not working

Hi All:cool:, i tried to automate SFTP process after passwordless authendication. Stil i am getting error... Can anyone help.... ------------------- sample code below ------------------- sftp -v $mdskk@ << EOF cd /data mget *.tar.gz bye EOF... (2 Replies)
Discussion started by: senthil_seera
2 Replies

10. Shell Programming and Scripting

Automate batchfile generation for sFTP

Hey all, I am writing a script for sFTP using batchfile option (-B). My script is supposed to monitor a certain directory for several files and when they are found I will send them to a testing server. So using a static batchfile wouldn't be feasible, I am just wondering if anyone can show... (0 Replies)
Discussion started by: mpang_
0 Replies
Login or Register to Ask a Question
ssh_sftpd(3erl) 					     Erlang Module Definition						   ssh_sftpd(3erl)

ssh_sftpd - Specifies a channel process to handle a sftp subsystem. DESCRIPTION
Specifies a channel process to handle a sftp subsystem. COMMON DATA TYPES
subsystem_spec() = {subsystem_name(), {channel_callback(), channel_init_args()}} subsystem_name() = "sftp" channel_callback() = atom() - Name of the erlang module implementing the subsystem using the ssh_channel behavior see ssh_channel(3erl) channel_init_args() = list() - The one given as argument to function subsystem_spec/1. EXPORTS
subsystem_spec(Options) -> subsystem_spec() Types Options = [{Option, Value}] Should be used together with ssh:daemon/[1,2,3] Options are: {cwd, String} : Sets the initial current working directory for the server. {file_handler, CallbackModule} : Determines which module to call for communicating with the file server. Default value is ssh_sftpd_file that uses the file and filelib API:s to access the standard OTP file server. This option may be used to plug in the use of other file servers. {max_files, Integer} : The default value is 0 , which means that there is no upper limit. If supplied, the number of filenames returned to the sftp client per READDIR request, is limited to at most the given value. {root, String} : Sets the sftp root directory. The user will then not be able to see any files above this root. If for instance the root is set to /tmp the user will see this directory as / and if the user does cd /etc the user will end up in /tmp/etc . Ericsson AB ssh 2.0.4 ssh_sftpd(3erl)