Remote dir "Permission denied" - WinSCP delete ALL content
Hello,
WinSCP Version 5.7 (Build 5125)
Don't know if it's a bug or it's a feature. But behaviour is a little bit strange.
Due admin's mistake on the remote server were lost permissions for ssh account which copies files from remote directory.
WinSCP in writes to log:
And then WinSCP continues synchronization job and just deletes all files which are already stored locally.
In the attached session log I've reproduced this situation.
1st part of log - permission on remote server are Ok.
2nd part of the log (timestamp 13:14:49.588): permissions lost and WinSCP deleted all content which was copied in previous session.
I know this works on this manner because I use switch -delete. But I think it's illogical when WinSCP cannot read remote folder it shouldn't delete what was already synchronised.
Here is command line:
Script:
Session log file is attached.
Thanks.
WinSCP Version 5.7 (Build 5125)
Don't know if it's a bug or it's a feature. But behaviour is a little bit strange.
Due admin's mistake on the remote server were lost permissions for ssh account which copies files from remote directory.
WinSCP in writes to log:
. 2015-03-06 13:14:51.167 Listing directory "/Termsrv/Sync_folder/Test".
> 2015-03-06 13:14:51.167 Type: SSH_FXP_OPENDIR, Size: 34, Number: 779
< 2015-03-06 13:14:51.204 Type: SSH_FXP_STATUS, Size: 37, Number: 779
< 2015-03-06 13:14:51.204 Status code: 3, Message: 779, Server: Permission denied., Language: en
. 2015-03-06 13:14:51.204 Asking user:
. 2015-03-06 13:14:51.204 Error listing directory '/Termsrv/Sync_folder/Test'. ("Permission denied.
. 2015-03-06 13:14:51.204 Error code: 3
. 2015-03-06 13:14:51.204 Error message from server (en): Permission denied.")
< 2015-03-06 13:14:51.204 Script: Error listing directory '/Termsrv/Sync_folder/Test'.
< 2015-03-06 13:14:51.205 Script: Permission denied.
< 2015-03-06 13:14:51.205 Error code: 3
< 2015-03-06 13:14:51.205 Error message from server (en): Permission denied.
> 2015-03-06 13:14:51.167 Type: SSH_FXP_OPENDIR, Size: 34, Number: 779
< 2015-03-06 13:14:51.204 Type: SSH_FXP_STATUS, Size: 37, Number: 779
< 2015-03-06 13:14:51.204 Status code: 3, Message: 779, Server: Permission denied., Language: en
. 2015-03-06 13:14:51.204 Asking user:
. 2015-03-06 13:14:51.204 Error listing directory '/Termsrv/Sync_folder/Test'. ("Permission denied.
. 2015-03-06 13:14:51.204 Error code: 3
. 2015-03-06 13:14:51.204 Error message from server (en): Permission denied.")
< 2015-03-06 13:14:51.204 Script: Error listing directory '/Termsrv/Sync_folder/Test'.
< 2015-03-06 13:14:51.205 Script: Permission denied.
< 2015-03-06 13:14:51.205 Error code: 3
< 2015-03-06 13:14:51.205 Error message from server (en): Permission denied.
And then WinSCP continues synchronization job and just deletes all files which are already stored locally.
In the attached session log I've reproduced this situation.
1st part of log - permission on remote server are Ok.
2nd part of the log (timestamp 13:14:49.588): permissions lost and WinSCP deleted all content which was copied in previous session.
I know this works on this manner because I use switch -delete. But I think it's illogical when WinSCP cannot read remote folder it shouldn't delete what was already synchronised.
Here is command line:
winscp.exe /console /script=07.Test.cfg /log=07.Test.log
Script:
option echo off
option batch continue
option confirm off
open ssh-backup@BSRV
# Test
cd /Termsrv/Sync_folder/Test
lcd D:\backup\bbom\sync_folder\Test
synchronize local -delete -mirror
close
exit
option batch continue
option confirm off
open ssh-backup@BSRV
# Test
cd /Termsrv/Sync_folder/Test
lcd D:\backup\bbom\sync_folder\Test
synchronize local -delete -mirror
close
exit
Session log file is attached.
Thanks.