get -delete removes files and folder, but gives error message that the folder does not exist
get -delete "/my-folder/prod/my-download/*" "C:\my-folder\prod\my-download\"
To be clear – all the files and the folder are deleted from the remote, but WinSCP errors saying the folder does not exist when trying to delete it.
This is a problem, because it means that WinSCP correctly downloads and deletes the first folder and its contents, but then errors and won't download the rest of the folders and contents.
Am I doing something wrong?
Log file entry below. In this example,
folder-1
and contents have been correctly downloaded to my local folder. folder-1
and contents have then been correctly deleted from the remote server. However, WinSCP still gives me the error below and the script then fails.
Log File message
. 2021-09-12 12:27:08.926 Deleting file "/my-folder/prod/my-download/folder-1". > 2021-09-12 12:27:08.926 Type: SSH_FXP_RMDIR, Size: 125, Number: 69135 < 2021-09-12 12:27:09.020 Type: SSH_FXP_STATUS, Size: 141, Number: 69135 < 2021-09-12 12:27:09.020 Status code: 2, Message: 69135, Server: /my-folder/prod/my-download/folder-1, Language: US-ASCII . 2021-09-12 12:27:09.020 Asking user: . 2021-09-12 12:27:09.020 Error deleting file '/my-folder/prod/my-download/folder-1'. ("No such file or directory. . 2021-09-12 12:27:09.020 Error code: 2 . 2021-09-12 12:27:09.020 Error message from server (US-ASCII): /my-folder/prod/my-download/folder-1") < 2021-09-12 12:27:09.020 Script: Error deleting file '/my-folder/prod/my-download/folder-1'. < 2021-09-12 12:27:09.020 Script: No such file or directory. < 2021-09-12 12:27:09.020 Error code: 2 < 2021-09-12 12:27:09.020 Error message from server (US-ASCII): /my-folder/prod/my-download/folder-1 . 2021-09-12 12:27:09.020 Answer: Abort . 2021-09-12 12:27:09.020 Script: Failed . 2021-09-12 12:27:09.020 Script: Exit code: 1 . 2021-09-12 12:27:09.020 Closing connection. . 2021-09-12 12:27:09.020 Sending special code: 1 . 2021-09-12 12:27:09.192 Session sent command exit status 0