The UNIX and Linux Forums  

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 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-27-2007 10:25 PM
Sftp in Batch Mode sivaemn UNIX for Advanced & Expert Users 2 07-01-2007 03:52 AM
SSH in batch mode and File-Handles in a loop DaveCutler Shell Programming and Scripting 3 04-03-2007 03:39 AM
su command in batch mode Rajesh Gohad Shell Programming and Scripting 3 01-25-2007 09:54 PM
Help ! How to get elm to send multiple attachments - in batch mode anarvan UNIX for Dummies Questions & Answers 1 09-14-2005 05:41 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 01-20-2006
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 04:35 PM. Reason: removed email
Reply With Quote
Forum Sponsor
  #2  
Old 01-20-2006
linuxpenguin's Avatar
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.
__________________
War doesnt determine who is right, it determines who is left
Reply With Quote
  #3  
Old 01-20-2006
Registered User
 

Join Date: Jan 2006
Posts: 3
sorry, i am new to this forum.
i will remember that.
Reply With Quote
  #4  
Old 01-20-2006
linuxpenguin's Avatar
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.
__________________
War doesnt determine who is right, it determines who is left
Reply With Quote
  #5  
Old 01-23-2006
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.
Reply With Quote
  #6  
Old 01-23-2006
Registered User
 

Join Date: Oct 2002
Posts: 676
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 03:43 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0