Schedule a tranfer

Advertisement

kccja
Guest

Schedule a tranfer

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 ! :roll:

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: Schedule a tranfer

You will need to wrap call to WinSCP into some script (Perl, PHP, ...) that will generate the name of the file.

Reply with quote

rose
Guest

help me Example

:wink: Hello admin !
plase give me some Example "Schedule a tranfer" with PHP
thank you very much

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: help me Example

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?

Reply with quote

rose
Guest

exemple

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

Reply with quote

Advertisement

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

Reply with quote

rose
Guest

example not word

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

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: example not word

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? :-)
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

Reply with quote

Advertisement

Guest

EAccessViolation

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,

Reply with quote

Matatan
Guest

Re: EAccessViolation

martin 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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: EAccessViolation

Matatan wrote:

could you please provide the link to download 3.7.6?
You should better download the latest version, 3.8.2.

Reply with quote

matatan
Guest

Re: EAccessViolation

martin 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,

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: EAccessViolation

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?

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.

Reply with quote

mjraley
Joined:
Posts:
4
Location:
Seattle, WA

Re: EAccessViolation

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.

-- 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

Reply with quote

Advertisement

You can post new topics in this forum