Topic "File Copy Error"

Author Message
Guest




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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24993
Location: Prague, Czechia
Correct command would be:
Code:
get * E:\Misc Data\linux_backup\colorado1\current\

Note the backslash at the end. Read "help get".
_________________
Martin Prikryl
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
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