Automate batchfile generation for sFTP


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Automate batchfile generation for sFTP
# 1  
Old 04-26-2006
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 me how to dynamically generate the batchfile (which I assume is simply a text file) when the file is found, then I can use it to invoke sFTP. Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sftp using batchfile - storing result local

I'm making an sftp-connection to a remote server. I want the result of an ls-command in a local file and the result of ls on another folder in another local file. Because everything has to go as fast a possible I wan't to do everyting in one connection. The command I use is : psftp -v -batch -b... (4 Replies)
Discussion started by: pistach
4 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

Help on commands in sftp using BatchFile

Hi, The script didn't continue as "20130109" folder is already created on the destination server. Please help. Entry in script: cat > $filebatch << __EOF__ mkdir $current_date mkdir $current_date/$fpdomain cd $current_date/$fpdomain ls -l __EOF__ Error: sftp -b... (12 Replies)
Discussion started by: chococrunch6
12 Replies

5. Shell Programming and Scripting

keypair generation for passwordless sftp

Hi, I want to establish a passwordless sftp between the two servers. I've searched the net and know the steps to be taken; which are as follows: $ ssh-keygen -t rsa Generating public/private rsa key pair. Enter file in which to save the key (~/.ssh/id_rsa): ~/.ssh/id_rsa already... (3 Replies)
Discussion started by: dips_ag
3 Replies

6. Shell Programming and Scripting

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) do (0 Replies)
Discussion started by: vedder191
0 Replies

7. Shell Programming and Scripting

sftp can't fine batchfile "No such file or directory"

Hi, I've got a C program that is using execlp to run a non-interactive sftp (using a batchfile) session to send some files to another system. Just before doing that, I create the batchfile called sftp_batch on the fly: V8_26_1:sun-->cat /workspace/sftp_batch cd /tmp/newsftp put test.file... (2 Replies)
Discussion started by: Fiaran
2 Replies

8. Shell Programming and Scripting

Passing variables: sftp using -b batchfile

Hi All, I have created a script for an sftp transfer that works without a date variable being passed, I want it to work with a date variable being passed. So, my initial script, mainsftp.sh, looks like this: ----------------------------------------------------------------------- #... (1 Reply)
Discussion started by: j_miller
1 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@100.4.4.75 << EOF cd /data mget *.tar.gz bye EOF... (2 Replies)
Discussion started by: senthil_seera
2 Replies

10. Shell Programming and Scripting

sftp -b doesn't read the batchfile

Several of our end-users need to send a file to our insurance carrier using ssh and sftp. We've put together a Windows VBS script that opens the ssh tunnel and calls sftp with the -b option pointing to a batch script in the same directory, however sftp doesn't seems to be reading from the... (1 Reply)
Discussion started by: kmw
1 Replies
Login or Register to Ask a Question
SEND-UUCP(8)						      System Manager's Manual						      SEND-UUCP(8)

NAME
send-uucp, send-nntp, send-ihave - send Usenet articles to remote site SYNOPSIS
{ send-nntp | send-uucp | send-ihave } [ -d ] sitename:hostname | sitename [ sitename:hostname | sitename .. ] DESCRIPTION
The send-* utilities are scripts that process the batch files written by innd(8) to send Usenet articles to a remote NNTP or UUCP site. The sites to be fed may be specified by giving sitename hostname pairs on the command line. The sitename is the label the site has in the newsfeeds file, the hostname is the real hostname of the remote site, a FQDN (Fully Qualified Domain Name) in the case of an NNTP host, or the UUCP name in the case of a UUCP host. Normally, the sitename and the hostname are the same, and as such don't have to be specified as sitename:hostname pairs but just as a sitename. send-uucp compresses batches of news and sends the to the remote site with uux. send-nntp Starts an innxmit to send the articles to the remote site. send-ihave encapsulates the articles in an ihave control message and uses inews to send the articles to a to.sitename pseudo-group. Using send-ihave is discouraged, nobody uses it anymore and even the author of this manpage is unsure as to how it actually works or used to work. send-* expect that the batchfile for a site is named <pathoutgoing in inn.conf>/sitename. To prevent batchfile corruption, shlock(1) is used to ``lock'' these files. OPTIONS
-d The ``-d'' flag causes nntpsend to send output to stdout rather than the log file <pathlog in inn.conf>/<program-name>.log. NOTES
You should probably not use send-nntp, but innfeed, or if that is not possible, nntpsend. The usual flags in the newsfeed file to write a batch file suitable for processing by send-uucp are Tf,Wfb . The usual flags for a batch file for send-nntp are Tf,Wfm SEE ALSO
newsfeeds(5), nntpsend(8) SEND-UUCP(8)