Sponsored Content
Top Forums Shell Programming and Scripting SFTP to server through Shell Script Post 302483985 by Kishore_1 on Wednesday 29th of December 2010 08:26:16 AM
Old 12-29-2010
SFTP to server through Shell Script

I am sftp-ing to a server through a shell script from my local machine.

sftp user@host
put out.txt
bye

On executing the script, it prompts to enter the password, and after giving the password it successfully connects to the host.But the problem is that the remaining statements after the connection statement(in line1) are not getting executed.The out.txt is the file I want to put in the sever, then disconnect..

How can I achieve this through a shell script program?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to connect sftp server using script

Hi friend I have a command: sftp -v dtxsttp90102@dtx.us.dell.com I need to connect sftp server using above command and grep for some files and need to back to script can anyone tell me how to write script connectingSFTP.sh -------------------- sftpCmd=`sftp -v... (1 Reply)
Discussion started by: kittusri9
1 Replies

2. Shell Programming and Scripting

SFTP Shell Script from a Unix server to another

I am facing a typical issue for transfering files through secured FTP (SFTP) for example, i have three different servers a,b & c server A - where data file resides Server B - where Unix shell program resides here(source server) server C - Destination server I wanted to run the shell... (1 Reply)
Discussion started by: kumarm
1 Replies

3. Shell Programming and Scripting

Use cURL in shell script and get most recent file from remote server using SFTP

I have been trying to implement the following shell script -- sftp to remote server get list of files in the directory sftp get the most recent listed file exit This script will be scheduled to be executed everyday using CRON or CONTROL-M and the need is to have absolutely no human... (7 Replies)
Discussion started by: toobrown1
7 Replies

4. Shell Programming and Scripting

Script connecting to SFTP server

hi, i have to type a script that connect to a server SFTP(password not required) and run some easy command (e.g. ls,rm,mv,etc...). I wrote into the script the connection-string and the other commands. When I run it, it connects perfectly to the server but it stops at the home. Here is... (8 Replies)
Discussion started by: zangarules
8 Replies

5. Shell Programming and Scripting

SFTP-how to log individual sftp command error while executing shell script

Hi, I have situation where i need to automate transferring 10000+ files using sftp. while read line do if ; then echo "-mput /home/student/Desktop/folder/$line/* /cygdrive/e/folder/$line/">>sftpCommand.txt fi done< files.txt sftp -b sftpCommand.txt stu@192.168.2.1 The above... (1 Reply)
Discussion started by: noobrobot
1 Replies

6. Shell Programming and Scripting

i want to execute shell script on remote server with in sftp session

Hi, I want to execute shell script with in sftp session for remote server. like i have a shell script test.sh that is on local server.i want to execute that script on remote server sftp user@192.168.56.10 sftp> test.sh ---execute for remote server not for local server. sftp... (3 Replies)
Discussion started by: SAUD PASHA
3 Replies

7. Shell Programming and Scripting

Sftp script for dev server to client server

hi, i am new to unix, cuold u send some sftp acripts to send files to dev server to clint server, (1 Reply)
Discussion started by: Koti.annam
1 Replies

8. Solaris

Script to get files from remote server to local server through sftp without prompting for password

Hi, I am trying to automate the process of fetching files from remote server to local server through sftp. I have the username and password for the remote solaris server. But I need to give password manually everytime i run the script. Can anyone help me in automating the script such that it... (3 Replies)
Discussion started by: ssk250
3 Replies

9. Shell Programming and Scripting

Needed SFTP script from windows to UNIX server and from UNIX to windows server(reverse SFTP)

hi guys, i need a script to sftp the file from windows to unix server ....(before that i have to check whether the file exists in the windows server or not and again i have to reverse sftp the files from unix to windows server..... regards, Vasa Saikumar. (13 Replies)
Discussion started by: hemanthsaikumar
13 Replies

10. HP-UX

Shell script to sftp files to file server.

Hi, I am looking for a shell script to sftp to a file server and copy all the files from a directory after the script is run. The server name should be a user input parameter and of-course the username/password as well. Rest all should be handled by the script. I tried with below snippet:-... (2 Replies)
Discussion started by: happysingh
2 Replies
asadmin-get-client-stubs(1AS)					   User Commands				     asadmin-get-client-stubs(1AS)

NAME
asadmin-get-client-stubs, get-client-stubs - gets the stubs of the client SYNOPSIS
get-client-stubs --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile filename] [--terse=false] [--echo=false] [--interactive] --appname application_name local_directory_path Gets the client stubs JAR file for an AppClient standalone module or an application containing the AppClient module, from the server machine to the local directory. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. --echo setting to true will echo the command line statement on the standard output. --interactive prompts you for the required options that are not already specified. --appname name of the application. OPERANDS
local_directory_path path to the local directory where the client stub should be stored. Example 1: Using get-client-stubs asadmin> get-client-stubs --user admin --password adminadmin --host fuyako --port 7070 --appname myapplication.ear /sample/exmple EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-undeploy(1AS) J2EE 1.4 SDK March 2004 asadmin-get-client-stubs(1AS)
All times are GMT -4. The time now is 08:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy