Topic "Schedule a tranfer"

Author Message
kccja

Guest


Is it possible to Schedule one file transfert each days at the same time (the file name depend of the date of the Day ?

Example: to day we are The 07-08-2005 and i like to get the following file WFR2yyyymmddDE1 at 12 o clock.
yyyymmdd is date of the day.

Tancks for your Help ! Rolling Eyes
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
You will need to wrap call to WinSCP into some script (Perl, PHP, ...) that will generate the name of the file.
_________________
Martin Prikryl
rose

Guest


Wink Hello admin !
plase give me some Example "Schedule a tranfer" with PHP
thank you very much
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
rose wrote:
Wink Hello admin !
plase give me some Example "Schedule a tranfer" with PHP
thank you very much

How can I give you an example, when I do not give me any hint as to what you want to do?
_________________
Martin Prikryl
rose

Guest


Idea Window machine - Data store: file "daiyly20050810.dat"
daiyly 2005 08 10 Window machine automatic upload file -> Server.
thank
rose

Guest


i read exemple:
option batch on
# Disable overwrite confirmations that conflict with previous
option confirm off
# Connect
open user@example.com
# Change remote directory
cd /home/user
# Force binary mode transfer
option transfer binary
# Download file to local directory d:\
get examplefile.txt d:\
# Disconnect
close
exit
but server using password?
and Schedule a tranfer
"
Window machine - Data store: file "daiyly20050810.dat"
daiyly 2005 08 10 Window machine automatic upload file -> Server.
"
thank
rose

Guest


Schedule
upload.bat:
**************************
:: upload.bat
::
:: Daily upload
::
::
@ECHO ON
schtasks /create /tn "Upload" /tr "C:\WinSCP3\winscp3.com /script=C:\Batch\upload.scp" /sc daily /mo 1 /st 11:15 /ru rose /rp rose
ECHO

***************************
utomatic upload to server
upload.scp

# Automatically answer all prompts negativelly not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with previous
option confirm off
# Connect
open rose@98.168.0.100
# Change remote directory
cd /home/rose
# Upload file to current working directory
put C:\test.txt
# Disconnect
close
# Exit WinSCP
#exit

**************************

if admin have different way plase tell me
thank
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
I still do not understand. I do not see any problem with your script. It probably does what you want to do. So what do you want me to help you with? Smile
Is your problem that you do not know, how to pass a password to the script?

Edit: Please read FAQ on scheduling.

Last edited by martin on 2008-02-13; edited 1 time in total
F-OFF

Guest


The problem is....is that you seem to be a dick.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
F-OFF wrote:
The problem is....is that you seem to be a dick.

That explains everything.
_________________
Martin Prikryl
Guest




Hi,
I'm trying to write a small script like it connects the linux box and get the log from a /var/log to windows.

my script is (copyLog.scp)

# Getting the log
option batch on
# Disable overwrite confirmations that conflict
option confirm off
# Connect
open root@10.11.17.227
# Change remote directory
cd /var/log/
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:\
get host.log c:\
# Disconnect
close
# Exit WinSCP
exit

I'm running it as
C:\WinSCP3>WinSCP3.com /script=copyLog.scp

I'm getting the error as

batch on
confirm off
EAccessViolation
No session.
transfer binary
No session.
No session.

I think by this the connection itself is not happened, Please share the ideas how to get out of that EAccessViolation

Thanks,
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
If you are using 3.8 beta, please downgrade to 3.7.6.
_________________
Martin Prikryl
Matatan

Guest


prikryl wrote:
If you are using 3.8 beta, please downgrade to 3.7.6.


could you please provide the link to download 3.7.6?

ThX.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Matatan wrote:
could you please provide the link to download 3.7.6?

You should better download the latest version, 3.8.2.
_________________
Martin Prikryl
matatan

Guest


prikryl wrote:
Matatan wrote:
could you please provide the link to download 3.7.6?

You should better download the latest version, 3.8.2.


the latest version does not allow for wildcard transmission; meaning I can't download a group of files from one directory who's extention is xls. I've downloaded the 3.7.6 version and got my script to work.

But I have another question. and I'll explain the scenerio... there is a remote directory that is populated with files that have the date stamped on the filename (format: filename_YYYYMMDD_timestamp, ex:test_20061102_115255) I would like to download all the files that are created for that particular day onto my local drive. if this can be done please provide an example.

ThX,
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
matatan wrote:
the latest version does not allow for wildcard transmission; meaning I can't download a group of files from one directory who's extention is xls.

It is not true. Why do you think so?

Quote:
But I have another question. and I'll explain the scenerio... there is a remote directory that is populated with files that have the date stamped on the filename (format: filename_YYYYMMDD_timestamp, ex:test_20061102_115255) I would like to download all the files that are created for that particular day onto my local drive. if this can be done please provide an example.

You will need to dynamically modify your script. You may use the very same techniques as shown in this example.
mjraley
[View user's profile]

Joined: 2007-12-28
Posts: 4
Location: Seattle, WA
matatan wrote:

-snipped-

But I have another question. and I'll explain the scenerio... there is a remote directory that is populated with files that have the date stamped on the filename (format: filename_YYYYMMDD_timestamp, ex:test_20061102_115255) I would like to download all the files that are created for that particular day onto my local drive. if this can be done please provide an example.

ThX,

you need to generate ftp script dynamically through a program
language such as Perl,PHP, VBscript, etc...
since you can't predict the exact time stamp you'll need to
wildcard that part. Or you will need to rename or delete
the remote files after download so they don't match your pattern
the next time.

this is a portion of a euphoria program
that creates a macro to grab a file that includes
the day of the year value in it's name
(previously stored in GD_Julian variable).
this is only one possible mode, you
could use /command parameter but would have to deal
with double qoutes.

Code:

-- open new ftp macro file for write
-- '\n' is new line char '\\' is escaped backslash
integer df -- variable to hold the file#
df = open("testscp.get","w")
 puts(df,"option batch abort\noption confirm off\n")
 puts(df,"option echo off\noption transfer ascii\n")
 puts(df,"cd /remotefolder\n LCD c:\\data\\\n")
 puts(df,"get myfile_" & GD_Julian &"*.txt\n")
 puts(df,"exit\n")
close(df)

-- call ftp client from Euphoria program
integer handle -- variable to hold the result from FTP
handle = system_exec(
                     "winscp405.exe /script=testscp.get "
                   & "/ini=c:\\tools\\bin\\winscp_normal.ini "
                   & "host"
                    ,0)
-- ftp failed. Send result back to windows task scheduler
if handle then abort(1) end if
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