Topic "problem with cache using script"

Author Message
Leti

Guest


I use a script in order to recover my log files on the server. They're in a path like : exec/applis/myAppli/current/logs, current indicating the active version of the application.

When I launch my script, instead of going in active "current", WinSCP goes in the last "current" visited on this server. I tried to empty the cache via WinSCP, but it doesn't works.

An idea how to regulate this problem ?
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Setup a stored session with option "Cache directory changes" turned off. Use that stored session from your script.
_________________
Martin Prikryl
Guest




prikryl wrote:
Setup a stored session with option "Cache directory changes" turned off. Use that stored session from your script.


we can use the stored sessions from the scripts ?? because I have stored all the session I use to launch (one per server), so if it's possible to lauch them, it would be interessant to me Smile ...

however, if you have an example calling a session with all parameters defined (host, login ...) and an example with a session "empty", I would be very happy Smile
Leti

Guest


I'm the "Guest" Embarassed
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Both command line parameter and script command "open" parameter can be name of stored session. Only if the value is not existing session it is treated (parsed) as an URL.

See
winscp3 /?
or
help open (fron console)
Leti

Guest


I have try at this moment, but it doesn't works Sad ...

I use a script that recover the logs from several servers :

Code:
 
 rem boucle sur les serveurs
for /L %%i in (68,1,80) do call ::Go %%i
goto :end

 rem Creation du fichier des commandes SFTP
echo option confirm off>sftp.txt
echo open %LOGIN%:%PASSWORD2%@xx.xxx.xxx.%1>>sftp.txt
echo cd ../../exec/applis/myAppli/current/logs>>sftp.txt
echo option transfer binary>>sftp.txt
echo get *.log c:\recup_FTP\80\>>sftp.txt
echo close>>sftp.txt
   rem echo exit>>sftp.txt
 
winscp3 /console /script=sftp.txt


as you can see, I make my script for each server, opening the session with login, password and host in parameter.

how can I open a session stored in WinSCP ? I have tried to use the command :

Code:
open nameOfMySession


but then it ask for the login and password Sad ...
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Do you run the script with the same account (on local machine) as with which you have configured the stored session? (read corresponding FAQ).
_________________
Martin Prikryl
Leti

Guest


prikryl wrote:
Do you run the script with the same account (on local machine) as with which you have configured the stored session? (read corresponding FAQ).


It's a .bat script, that I run from my Windows Desktop ... So, it didn't use a particular account ...
This is the script launched by WinSCP :

Code:
option confirm off
open login:password@xx.xxx.xx.xx
cd ../../exec/applis/myAppli/current/logs
option transfer binary
get *.log c:\myDirectory\
close


I've read your FAQ, I have activated the .ini file and configured the options of cache I wanted :

Code:
[Sessions\Default%20Settings]
CacheDirectories=0
CacheDirectoryChanges=0
PreserveDirectoryChanges=0


It works !!!!!!!!!!!!!!! thank you for your help !!
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License