The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
SFTP in batch Mode ilok AIX 1 08-28-2007 01:25 AM
Sftp in Batch Mode sivaemn UNIX for Advanced & Expert Users 2 07-01-2007 06:52 AM
SSH in batch mode and File-Handles in a loop DaveCutler Shell Programming and Scripting 3 04-03-2007 06:39 AM
su command in batch mode Rajesh Gohad Shell Programming and Scripting 3 01-26-2007 12:54 AM
Help ! How to get elm to send multiple attachments - in batch mode anarvan UNIX for Dummies Questions & Answers 1 09-14-2005 08:41 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-20-2006
mlim1111 mlim1111 is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 3
SFTP in batch mode

I need to transfer some files from AIX box-A to box-B
using "sftp" . I have no problem using command line prompt.
But I just cannot make this work inside a script.
I need this to create a job under CRON and let it run automatically.
Can anyone show me an example.

Thanks in advance

Michael Lim
email removed

Last edited by vgersh99; 01-20-2006 at 07:35 PM.. Reason: removed email
  #2 (permalink)  
Old 01-20-2006
linuxpenguin's Avatar
linuxpenguin linuxpenguin is offline Forum Advisor  
Registered User
  
 

Join Date: May 2002
Location: India
Posts: 295
hey you broke the rule of the forum, you cant float your email id.
Dunno, if I can edit your message and remove that from there, some guys on the forum do that, wonder how they do it.
  #3 (permalink)  
Old 01-20-2006
mlim1111 mlim1111 is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 3
sorry, i am new to this forum.
i will remember that.
  #4 (permalink)  
Old 01-20-2006
linuxpenguin's Avatar
linuxpenguin linuxpenguin is offline Forum Advisor  
Registered User
  
 

Join Date: May 2002
Location: India
Posts: 295
good ,
now coming to your question.

Can you tell me how you do it using command line. We will just list all the commands you use on your command line, into a file and call this a script. We will name this file. Change its permissions to ensure it has execute permissions. and then we will enter this script file in as a cron job. So first, tell us what are the commands that you use on your command line to do the sftp.
  #5 (permalink)  
Old 01-23-2006
mlim1111 mlim1111 is offline
Registered User
  
 

Join Date: Jan 2006
Posts: 3
SFTP in batch mode

Here is my script :

sftp server-B <<! >>$OUT 2>&1
user dba1 pwd_xxx
bin
cd /oldumpfs/DR
lcd /tmp2/DR
put file1
bye
!

It did not like the user and password I passed in the script.
  #6 (permalink)  
Old 01-23-2006
dangral dangral is offline Forum Advisor  
Registered User
  
 

Join Date: Oct 2002
Posts: 699
Don't forget to search through the FAQ before asking a question that may have already been answered. Look at the last sentence in this link:

FTP FAQ
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:59 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0