Press 'Delete' to delete the file and create new one instead of overwriting it

Advertisement

jkexbx
Joined:
Posts:
2

Press 'Delete' to delete the file and create new one instead of overwriting it

I'm trying to create a script to automatically upload files to a SFTP site. I want it to upload new copies if the file size if different, or just upload everything new each time. Sorry for all the cleansing I had to do.

The command I'm running is below and this will upload new files fine. But if the file already exists it gives the below error message.
/command " option batch continue" "open sftp://######:######@######//" "put ""C:\##########\*"" ""/##########/""" "exit"
. 2021-06-09 14:05:39.856 File: 'C:\#######\Log_201804_001.xls' [2020-06-22T12:51:39.850Z] [53248]
. 2021-06-09 14:05:39.858 Copying "C:\#######\Log_201804_001.xls" to remote directory started.
. 2021-06-09 14:05:39.858 Binary transfer mode selected.
. 2021-06-09 14:05:39.858 Opening remote file.
> 2021-06-09 14:05:39.858 Type: SSH_FXP_OPEN, Size: 71, Number: 11011
< 2021-06-09 14:05:39.936 Type: SSH_FXP_STATUS, Size: 36, Number: 11011
< 2021-06-09 14:05:39.936 Status code: 3, Message: 11011, Server: Permission denied, Language: en 
> 2021-06-09 14:05:39.937 Type: SSH_FXP_LSTAT, Size: 55, Number: 11271
< 2021-06-09 14:05:39.977 Type: SSH_FXP_ATTRS, Size: 37, Number: 11271
* 2021-06-09 14:05:39.978 (ETerminal) Permission denied.
* 2021-06-09 14:05:39.978 Error code: 3
* 2021-06-09 14:05:39.978 Error message from server (en): Permission denied
. 2021-06-09 14:05:39.978 Asking user:
. 2021-06-09 14:05:39.978 Cannot overwrite remote file '/########/Log_201804_001.xls'.$$
. 2021-06-09 14:05:39.978  
. 2021-06-09 14:05:39.978 Press 'Delete' to delete the file and create new one instead of overwriting it.$$ ("Permission denied.
. 2021-06-09 14:05:39.978 Error code: 3
. 2021-06-09 14:05:39.978 Error message from server (en): Permission denied")
< 2021-06-09 14:05:39.978 Script: Cannot overwrite remote file '/#######/Log_201804_001.xls'.
< 2021-06-09 14:05:39.978 Script: Permission denied.
< 2021-06-09 14:05:39.978 Error code: 3
< 2021-06-09 14:05:39.978 Error message from server (en): Permission denied
* 2021-06-09 14:05:39.979 (ESkipFile) Cannot overwrite remote file '/######/Log_201804_001.xls'.$$
* 2021-06-09 14:05:39.979  
* 2021-06-09 14:05:39.979 Press 'Delete' to delete the file and create new one instead of overwriting it.$$
* 2021-06-09 14:05:39.979 Permission denied.
* 2021-06-09 14:05:39.979 Error code: 3
* 2021-06-09 14:05:39.979 Error message from server (en): Permission denied

Reply with quote

Advertisement

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

Re: Press 'Delete' to delete the file and create new one instead of overwriting it

I'm not sure what your question is. You seem to try to overwrite a file, for which you do not have write permissions.

Reply with quote

jkexbx

MY apologizes! I do not have permission to overwrite a file, but I do have permission to delete them. I was wondering how I get it to perform the "Press 'Delete' to delete the file and create new one instead of overwriting it."

Thanks

Reply with quote

Advertisement

You can post new topics in this forum