Topic "Ignore/Skip All Permissions or Resume Support Errors"

Author Message
scruff410
[View user's profile]

Joined: 2013-04-26
Posts: 2
I have a client that immediately grabs all uploaded files to their ftp site once a file handle is closed on the file. This prevents resume support and changing permissions to work. Thus, I'd like to ignore such errors or disable the action causing them, but I haven't been able to find proper documentation on how to do this from a script.

Here is the command line:
Code:
WinSCP.com /script=G:\code\Statement_Upload.txt


Here is the script:
Code:
# Automatically abort script on errors
option batch abort
# Enable overwrite confirmations that conflict with the previous
option confirm on
# Force binary mode transfer
option transfer binary
# Establish the connection to the Statements account
open sftp://user:pass@ftp.site.com:portnumber
# Change the Local Directory
lcd "X:\statements\ToBeSent"
# Change to the correct Remote directory
cd /
# Upload the files ending with .TXT
put -nopermissions -resumesupport=off *.TXT
# Exit
exit


After running the script I get the following output in the console:
Code:
C:\Program Files (x86)\WinSCP>WinSCP.com /script=G:\code\Statement_Upload.txt
batch           abort
confirm         on
transfer        binary
Searching for host...
Connecting to host...
Authenticating...
Using username "user".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] user@ftp.site.com
X:\statements\ToBeSent
/
4061116.TXT               |         82 KiB |   20.9 KiB/s | binary | 100%
Upload of file '4061116.TXT' was successful, but error occurred while setting th
e permissions and/or timestamp. If the problem persists, turn on 'Ignore permiss
ion errors' option.
No such file or directory.
Error code: 2
Error message from server (en): File not found
Request code: 9
(A)bort, (R)etry, (S)kip, Ski(p) all: Abort

C:\Program Files (x86)\WinSCP>


Using WinSCP 5.2.0 (Build 3157) on Windows 7 Professional SP1.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
The -nopermissions and -resumesupport=off is correct. Just add -nopreservetime and you should be fine.

See also:
https://winscp.net/eng/docs/faq_not_owner
scruff410
[View user's profile]

Joined: 2013-04-26
Posts: 2
Excellent, that worked. I'd recommend adding more text to the error displayed in this instance to suggest the use of the -nopreservetime tag. Thanks again for the quick help. You're a rock star!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
scruff410 wrote:
Excellent, that worked. I'd recommend adding more text to the error displayed in this instance to suggest the use of the -nopreservetime tag. Thanks again for the quick help. You're a rock star!

WinSCP is primarily GUI client, so the error messages cannot refer to scripting switches.
_________________
Martin Prikryl
parisilon1

Guest


Hello,

I've seen a few solutions to turn off transfer resume support but none of them are working for me. And yes, I have read the FAQ. I'm trying to do this using a script. I'm using version 4.2.9

Here is the script I'm using:

option batch abort
option confirm off
open "sftp://user:password@myhost.us.db.com:0000"
option transfer binary
cd /user/user/outbox/target
lcd "mylocaldirectory"
put -nopermissions -resumesupport=off -nopreservetime *
close
exit

I get this error
Unknown switch 'resumesupport'.

What am I doing wrong? Again, I've tried to read the FAQ.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
parisilon1 wrote:
I get this error
Unknown switch 'resumesupport'.

What am I doing wrong? Again, I've tried to read the FAQ.

The -resumesupport switch was introduced in 5.2 beta only:
https://winscp.net/tracker/show_bug.cgi?id=834
https://winscp.net/eng/docs/faq_script_switch
Vinay

Guest


I tried same settings in vb.net using following code;
Dim transferOptions As New TransferOptions
transferOptions.ResumeSupport = TransferResumeSupportState.Off

but this gives error that Property is Read Only.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Vinay wrote:
I tried same settings in vb.net using following code;
Dim transferOptions As New TransferOptions
transferOptions.ResumeSupport = TransferResumeSupportState.Off

but this gives error that Property is Read Only.

The TransferOptions.ResumeSupport is of type TransferResumeSupport, not TransferResumeSupportState.
See
https://winscp.net/eng/docs/library_transferoptions
https://winscp.net/eng/docs/library_transferresumesupport
_________________
Martin Prikryl
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