Unable to copy file from FTP

Advertisement

Milliana
Joined:
Posts:
2

Unable to copy file from FTP

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,317
Location:
Prague, Czechia

Re: Unable to copy file from FTP

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.

Reply with quote

Milliana
Joined:
Posts:
2

Re: Unable to copy file from FTP

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

Reply with quote

Advertisement

You can post new topics in this forum