Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: -nopermissions option not working

Have you tried adding -nopreservetime?

-nopermissions option not working

I'm trying to script some commands using winscp so I can have a user run a .cmd windows batch file but some of the winscp commands don't seem to be working. It copies the file but it returns an exit code of 1 and an error because it's trying to set the permissions and/or timestamp on the remote server. Here is the command I'm running and the log output. I am running version 4.2.3 of winscp.

.cmd file contents:

@echo on
C:\PROGRA~1\WinSCP3\ /script=G:\Dacm\temp\copy_DA_tnsnames.txt > G:\DACM\TEMP\copy_DA_tnsnames.log

copy_DA_tnsnames.txt contents:

option batch on
option confirm off
open username@servername
cd /home/dataarch
option transfer ascii
put -nopermissions G:\DACM\TEMP\DA_tnsnames.ora

Logfile output:
batch on
confirm off
Searching for host...
Connecting to host...
Using username "username".
Authenticating with public key "xxxxxxxx" from agent.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] gm625270@devapp0
transfer ascii
G:\DACM\TEMP\DA_tnsnames.ora | 1 KiB | 0.0 KiB/s | ascii | 100%
Upload of file 'DA_tnsnames.ora' was successful, but error occurred while setting the permissions and/or timestamp. If the problem persists, turn on 'Ignore permission errors' option.
Permission denied.
Error code: 3
Error message from server: Permission denied
Request code: 9
(A)bort, (R)etry, (S)kip, Ski(p) all: Abort