Multiple Files

Advertisement

Caveo
Guest

Multiple Files

I am having an issue with my script not picking up multiple files. It will only grab the first file in the directory and then stop. How do I need to modify this script to upload multiple files? The files have different extensions which is why I used the mask filename*.

option batch on
option confirm off
open sftp://username@server.com -hostkey="ssh-rsa 1024 AA:AA:AA"
cd /incoming/test
put E:\folder\Filename*
exit

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Multiple Files

Your code looks ok. 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 may email it to me. You will find my address (if you log in) in my forum profile. Please include link back to this topic in your email. Also note in this topic that you have emailed the log.

Reply with quote

Caveo
Guest

Re: Multiple Files

The log is attached.

Line 70 in the log says "Copying 3 files/directories to remote directory" which is correct. There were 3 files when this was ran.

Line 93 says "Upload of file 'PosPay_1005_08202013_095943.txt' was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn on 'Ignore permission errors' option. ("Permission denied."

Would these errors cause the script to abort after the first file is transferred?

Reply with quote

Caveo
Guest

Re: Multiple Files

I answered my own question. The permission errors were causing the upload script to close.

This script works:

option batch on
option confirm off
open sftp://username@server.com -hostkey="ssh-rsa 1024 AA:AA:AA"
cd /incoming/test
put -nopermissions -nopreservetime E:\folder\Filename*
exit


Thank you for your assistance in directing me to the log files.

Reply with quote

Advertisement

You can post new topics in this forum