File Copy Error

Advertisement

Guest

File Copy Error

Hi!

I'm having a problem copying files from a Unix machine to a Windows machine for backup purposes. It works fine using the WinSCP GUI interface, but runs into trouble when scripting it. Here's the contents of my bat file:

winscp3 /console /script=C:\Scripts\backups.txt


Here's the contents of backups.txt:

option batch on
option confirm off
open xxxxx@xxx.xxx.xxx.xxx (hidden for security purposes)

cd colorado1/current
option transfer binary
get * E:\Misc Data\linux_backup\colorado1\current

close
exit


Here's the output when I run the script:

Microsoft Windows 2000 [Version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.

C:\>winscp3 /console /script=C:\Scripts\backups.txt
batch on
confirm off
Initialisation...
Searching for host...
Connecting to host...
Authenticating...
Using username "xxxxxx".
Authenticating with public key ""
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] xxxxxxx@xxx.xxx.xxx.xxx
/backup/colorado1/current
transfer binary
conf.tgz | 0 kB | 0.0 kB/s | binary | 0%
'E:\Misc Data\linux_backup\colorado1\current' is not file!
(A)bort, (R)etry, (S)kip, Ski(p) all: Abort
Session 'xxxxxxx@xxx.xxx.xxx.xxx' closed.
No session.


The line"'E:\Misc Data\linux_backup\colorado1\current' is not file!" is the error...it works fine if I just copy the files to the root of the E:\ drive, but it errors out if I try to copy the files to a sub-directory. Maybe it's just a syntax problem...any ideas about how I can fix this?

Thanks,

Donnie

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: File Copy Error

Correct command would be:
get * E:\Misc Data\linux_backup\colorado1\current\
Note the backslash at the end. Read "help get".

Reply with quote

Guest

Thanks! The slash at the end, plus putting the whole path in quotes solved the problem. I appreciate the response to a dumb question.

Donnie

Reply with quote

Advertisement

You can post new topics in this forum