Do you have a question? Post it now! No Registration Necessary. Now with pictures!
October 9, 2005, 5:01 pm
rate this thread
for MSWin32-x86-multi-thread Binary build 813  provided by
ActiveState is a division of Sophos.
Built Jun 6 2005 13:36:37
I need to get couple of files that match a particular pattern (which is
specified in a batch file) using a perlscript, which is copied in part
system("\"$SFTP\" -pw $pass -b $batch -be -bc $server");
command line echo of the above command:
C:\temp>c:\putty\psftp.exe -pw abc123 -b batch.txt -be -bc
the contents of the batch file are as under:
##end of batch file
At the time of running the get command through perl, my server has only
one file of interest in the remote directory (log.log). My assumption
is that psftp should attempt to pattern match all the lines in the
batchfile and get me the log.log from my unix server. However, it does
not. See the following output:
logging into firstname.lastname@example.org.
Using username "web".
Remote working directory is /usr/local/web
psftp> lcd c:\logs\intranet.abcd.com
New local directory is c:\logs\intranet.abcd.com
psftp> cd /web/logs/intranet.abcd.com
Remote directory is now /web/logs/intranet.abcd.com
Remote directory is /web/logs/intranet.abcd.com
Listing directory /web/logs/intranet.abcd.com
drwxrwxrwx 4 web web 1024 Oct 9 09:01 .
drwxrwxrwx 130 ftp web 4096 Oct 3 12:25 ..
drwxr-xr-x 2 web web 6144 Oct 9 06:06 archive
drwxr-xr-x 2 web web 2048 Oct 9 06:06 awstats
-rw-r--r-- 1 web web 19733 Mar 18 2005 foo1
-rw-r--r-- 1 web web 8065 Mar 18 2005 foo2
-rw-r--r-- 1 web web 13 Oct 9 09:01 log.log
psftp> get server*oct*9*
/web/logs/intranet.abcd.com/server*oct*9*: no such file or directory
psftp> get server*oct*8*
/web/logs/intranet.abcd.com/server*oct*8*: no such file or directory
psftp> get server*oct*7*
/web/logs/intranet.abcd.com/server*oct*7*: no such file or directory
psftp> get server*oct*6*
If I try again, say immediately in couple of seconds, psftp does not
even attempt to go through the first get command. Looks like some form
of caching is happenng here.
How do I force psftp to go through all commands from the batch file? I
tried arguement -be and that seem to have no effect.
- » Re: wcx Attorney Stephen R. Pappas, a thief and crooked as the day is long bgf
- — Next thread in » Secure Shell Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — Newest thread in » Secure Shell Forum