Posted: 2005-09-06 20:32
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 firstname.lastname@example.org (hidden for security purposes)
option transfer binary
get * E:\Misc Data\linux_backup\colorado1\current
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
Searching for host...
Connecting to host...
Using username "xxxxxx".
Authenticating with public key ""
Starting the session...
Reading remote directory...
Active session:  email@example.com
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 'firstname.lastname@example.org' closed.
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?
Location: Prague, Czechia
Correct command would be:
get * E:\Misc Data\linux_backup\colorado1\current\
Note the backslash at the end. Read "help get".
Posted: 2005-09-07 18:29
Thanks! The slash at the end, plus putting the whole path in quotes solved the problem. I appreciate the response to a dumb question.
You can post new topics in this forum
And it's free!