Sponsored Content
Top Forums Shell Programming and Scripting SFTP scripting - help required Post 302137693 by Cameron on Wednesday 26th of September 2007 10:25:40 AM
Old 09-26-2007
blowtorch is spot on.

The only time you'd ever have needed to use the password is when you initially establish your SFTP connection manually with the other host. After and using key-based authentication; you'd use something like ...
Code:
  sftp -v -o IdentityFile=${IdentityFile} \
       -b ${SFTP_BATCH_FILE} \
       ${USRID}@${IP_OR_DNS}:${REMOTE_DIR} 2>&1 | tee -a ${SFTPLOG}

Incidently, using the -B was in error, -B specifies the buffer size. Lower-case -b is used when you have a batch-file.

Helps to keep -v included, it raises the loggin level and helps when trying to determine why things don't go as expected.

You'll never be able to perform what you are trying to do autonomously without key-based authentication. It's not that hard to setup, just requires a bit of reading and small amount of trial and error. Tip - Don't try establishing on LIVE or Production servers until you have a grasp of what you need to do. I hate seeing things go pear-shaped in Production. Smilie

HTH, let us know how you go. Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sftp scripting

I am totally new to this forum so if I am asking this and it has already been asked I apologize, but I have yet to have time to figure out how to search effectively for answers in previous posts. I'll figure it out tomorrow I just wanted to get this out there in case there is someone with this... (6 Replies)
Discussion started by: New_Guru
6 Replies

2. UNIX for Dummies Questions & Answers

Help required on expect scripting

I am trying to write an expect script for remote server login. At some point of time I need to telnet based on the output of grep command. Based on the output I need to select the ip address of the server. How can I write an expect script for the same. The output of the grep command is as follows:... (1 Reply)
Discussion started by: ayyappakumar
1 Replies

3. Shell Programming and Scripting

Help required on scripting the rm -f command

When i execute rm -f $1 via a script file named rmf, it is not deleting all the files, say starting with "sec". i have execute rmf for many times to remove all the occurrences... $rmf sec* - this should delete all files starting with sec, but not. The rm -f sec* is working fine. kindly help... (3 Replies)
Discussion started by: frozensmilz
3 Replies

4. Shell Programming and Scripting

Sftp scripting

Dear All, I have script that get the files from sFtp server to Unix server. The script is below. -- Batch File (mybatch) cd Output get abc123.csv in/abc123.csv get def456.csv in/def456.csv get ghi789.csv in/ghi789.csv bye -- Script File sftp -b mybatch xyz@111.222.33.4 >... (1 Reply)
Discussion started by: samrio
1 Replies

5. Shell Programming and Scripting

Help required with formatting in scripting

Hi Friends, I need to write a script which reads the file and prints them horizontally. For example, the file contains something like x1 x2 x3 x4 x5 my script reads this file as "for i in `cat filename`", but I need an output something like "config file = x1.ccfg,... (3 Replies)
Discussion started by: dineeshkg
3 Replies

6. Shell Programming and Scripting

Help Required in shell scripting

Hi, I am new to Unix shell scripting.I have a requirement where I have to search for a particular file in a Unix directory based on some criterian of the content of the file.Actually there would be two files with same name and then I have zip them together and stoe in the same directory. As... (1 Reply)
Discussion started by: Kunal Banerjee
1 Replies

7. Solaris

Required UNIX shell scripting material

As I am new in UNIX , and I want to learn UNIX shell scripting. where shall I get material for Scripting ( For basics fundamentals and production environmental scripts) Kindly provide me ...................... (7 Replies)
Discussion started by: sunray
7 Replies

8. Shell Programming and Scripting

Little scripting help required.

Hi , I need little help regarding my script. I have a file called abc which looks below. Rohan 12 Rakesh 23 Ajay 25 Another file looks like this (xyz). Mumbai Delhi Madras How would i add column mentioned in second file so that the file looks as below. Rohan 12 Mumbai... (2 Replies)
Discussion started by: pinga123
2 Replies

9. Shell Programming and Scripting

Required help in shell scripting

Iam new to shell scripting,i have a text file in my $home directory mentioned below. 201249_BAN_EXCL.TXT I need to refer the above file in my automated script but the number 201249 used to change every week.How can i refer to this file everyt time without renaming it manually? Thanks in... (7 Replies)
Discussion started by: Jroyal
7 Replies

10. Shell Programming and Scripting

Shell scripting help required

I have a shell script which calls a sql script. But in the output file I'm getting an additional '^L' character. Please advise how this is to be handled. spool /opt/oracle/DART/out/Indx_rebuild.out SET SERVEROUTPUT ON SET VERIFY OFF SET HEADING OFF SET NEWPAGE NONE SELECT 'ALTER INDEX '||... (2 Replies)
Discussion started by: narayanv
2 Replies
set_color(1)							       fish							      set_color(1)

NAME
set_color - set_color - set the terminal color set_color - set the terminal color Synopsis set_color [-v --version] [-h --help] [-b --background COLOR] [COLOR] Description Change the foreground and/or background color of the terminal. COLOR is one of black, red, green, brown, yellow, blue, magenta, purple, cyan, white and normal. o -b, --background Set the background color o -c, --print-colors Prints a list of all valid color names o -h, --help Display help message and exit o -o, --bold Set bold or extra bright mode o -u, --underline Set underlined mode o -v, --version Display version and exit Calling set_color normal will set the terminal color to whatever is the default color of the terminal. Some terminals use the --bold escape sequence to switch to a brighter color set. On such terminals, set_color white will result in a grey font color, while set_color --bold white will result in a white font color. Not all terminal emulators support all these features. This is not a bug in set_color but a missing feature in the terminal emulator. set_color uses the terminfo database to look up how to change terminal colors on whatever terminal is in use. Some systems have old and incomplete terminfo databases, and may lack color information for terminals that support it. Download and install the latest version of ncurses and recompile fish against it in order to fix this issue. Version 1.23.1 Sun Jan 8 2012 set_color(1)
All times are GMT -4. The time now is 03:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy