login about faq

I want to automate the connection and retrival of files using sftpg3.exe. I know how to use the -B batch file option to provide the input to the session. But How do I write the output to a text log file so that I can review it later as needed. Here is an example of by scheduled batch file which kicks off sftpg3 and the -B batch file:

kick.bat

set mydate=%date%

Set mydate=%mydate:~4,14%

set mydate=%mydate:/=%

set mytime=%time%

set mytime=%mytime:~0,8%

set mytime=%mytime::=%

sftpg3.exe -D 99 - v -B get_file.txt myid@server > e:\ScannedImages\log\%mydate%%mytime%.log

get_file.txt

verbose

binary

get *.zip

quit

asked Jul 15 '10 at 17:16

Nomi's gravatar image

Nomi
1111


The following seems to work:

kick.bat

set mydate=%date%

Set mydate=%mydate:~4,14%

set mydate=%mydate:/=%

Set mytime=%time%

set mytime=%mytime:~0,8%

set mytime=%mytime::=%

sftpg3.exe -D 99 -B get_file.txt myid@server 1> e:\log\WIN_%mydate%%mytime%.log 2> e:\log\SFTPG3_%mydate%%mytime%.log

get_file.txt

verbose

binary

get *.zip

quit

link

answered Jul 15 '10 at 19:14

Nomi's gravatar image

Nomi
1111

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×63

Asked: Jul 15 '10 at 17:16

Seen: 6,440 times

Last updated: Apr 08 '11 at 02:22

All user contributed content licensed under the cc-by-sa license.
Powered by OSQA.