Topic "Unable to copy file from FTP"

Author Message
Milliana
[View user's profile]

Joined: 2015-05-08
Posts: 2
Hello,
I've been trying to figure out for a while why an existing .bat script (using WinSCP) started failing when attempting to copy a file from an FTP site. It is called in a SQL Agent job (that has been running fine for months) and the error in the log is "No file matching .bak found". There is a single *.bak file in this location and I can access it via the WinSCP GUI. Here is the code:

cd C:\Program Files (x86)\WinSCP
WinSCP.com /console /command "option batch on" "option confirm off" "open SiteName" "get *.bak" "exit"

I've tried (unsuccessfully) searching online for ways to debug this, as well as where the SiteName info is stored to verify that it's correct, because I can't see it in the GUI. Also, tried replacing the SiteName with the URL generated from the GUI when I log in manually ( ftp://UserName:PW@HostName/folder/) and it doesn't work.

Any advice will be much appreciated.

Thank you,
Milliana
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please attach a full log file showing the problem (using the latest version of WinSCP).

To generate log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.
Milliana
[View user's profile]

Joined: 2015-05-08
Posts: 2
Hello, thank you for responding.
I had to fix this asap so I found a work around over the weekend - I created scripts which copy the entire folder (since there are only 2 other files in it and somehow the .bkp file wasn't being recognized individually), then once it has been copied over the .bkp file gets renamed, moved, and processed, and the folder gets deleted. An awesome first experience debugging/writing batch scripts Smile
Thanks for the tip. I'll create a log file and will try to figure out the initial issue from there on my own but the work around is running just fine.

Kind regards,
Milliana
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