"Access is denied" for local delete during synchronize

Advertisement

PapamoaMark
Joined:
Posts:
2
Location:
Bay of Plenty, New Zealand

"Access is denied" for local delete during synchronize

Can't for the life of me suss this one. Simple synchronize script to compare to a remote ftp server, updating the local machine with new, updated and deleted files/folders. Except it fails to delete local folders with Access is denied. I run the script as administrator, or not - same. The permissions for the folder are inherited, and include everyone=full control, current user is owner. If I manually delete the folder, then manually create it (or manually create a new folder), the manually created folder will delete. I have thoroughly compared permissions between existing and newly created folders - identical. The existing files/folders were originally copied there via another ftp client from the same remote ftp server source. The script is set to run monthly to update the local from the remote server, and works well - except for this annoying anomaly.

Files get deleted okay, but not folders - unless I manually created it.

Both client and server running Windows 10 Pro build 1709, not on a domain. Current user is an administrator user.

Can anyone shed some light for me?

Log output snip at fail time...
*****
< 2018-01-15 16:19:40.246 Script: Synchronizing...
. 2018-01-15 16:19:40.247 Synchronizing local directory 'd:\serva_repo\WIA_WDS\' with remote directory '/serva_repo/WIA_WDS/', params = 0x3 (Delete, NoConfirmation)
< 2018-01-15 16:19:40.248 Script: Error deleting file 'd:\serva_repo\WIA_WDS\Windows10ProUnattended\$OEN\$\$Boot$\$1\$WinPEDriver$\NIC\Network\Broadcom\BroadcomW_LLQWB2\7.35.295.0\src'.
< 2018-01-15 16:19:40.248 System Error. Code: 5.

< 2018-01-15 16:19:40.248 Access is denied
. 2018-01-15 16:19:40.254 Script: Failed
. 2018-01-15 16:19:40.254 Script: Exit code: 1
. 2018-01-15 16:19:40.257 Disconnected from server
*****
And the "handshaking etc at the front of the log...
*****
. 2018-01-15 16:18:24.882 --------------------------------------------------------------------------
. 2018-01-15 16:18:24.882 WinSCP Version 5.11.1 (Build 7725) (OS 10.0.15063 - Windows 10 Pro)
. 2018-01-15 16:18:24.883 Configuration: nul
. 2018-01-15 16:18:24.883 Log level: Normal
. 2018-01-15 16:18:24.883 Local account: DITSUPPORT\DIT
. 2018-01-15 16:18:24.883 Working directory: D:\Programs
. 2018-01-15 16:18:24.883 Process ID: 7580
. 2018-01-15 16:18:24.883 Command-line: "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console=5.11.1 /consoleinstance=_7252_101 "/ini=nul" "/script=d:\programs\pxesync.TXT" "/log=d:\programs\myscript.log"
. 2018-01-15 16:18:24.883 Time zone: Current: GMT+13, Standard: GMT+12 (New Zealand Standard Time), DST: GMT+13 (New Zealand Summer Time), DST Start: 30/09/2018, DST End: 1/04/2018
. 2018-01-15 16:18:24.884 Login time: Monday, 15 January 2018 4:18:24 PM
. 2018-01-15 16:18:24.884 --------------------------------------------------------------------------
. 2018-01-15 16:18:24.884 Script: Retrospectively logging previous script records:
> 2018-01-15 16:18:24.884 Script: open ftp://PXESync:***@xxxxxx.xxxxxx.co.nz:nnnn/
. 2018-01-15 16:18:24.884 --------------------------------------------------------------------------
. 2018-01-15 16:18:24.884 Session name: PXESync@xxxxx.xxxxx.co.nz (Ad-Hoc site)
. 2018-01-15 16:18:24.884 Host name: xxxxx.xxxxx.co.nz (Port: nnnn)
. 2018-01-15 16:18:24.884 User name: PXESync (Password: Yes, Key file: No, Passphrase: No)
. 2018-01-15 16:18:24.884 Transfer Protocol: FTP
. 2018-01-15 16:18:24.884 Ping type: Dummy, Ping interval: 30 sec; Timeout: 15 sec
. 2018-01-15 16:18:24.884 Disable Nagle: No
. 2018-01-15 16:18:24.884 Proxy: None
. 2018-01-15 16:18:24.884 Send buffer: 262144
. 2018-01-15 16:18:24.884 UTF: Auto
. 2018-01-15 16:18:24.884 FTPS: None [Client certificate: No]
. 2018-01-15 16:18:24.884 FTP: Passive: Yes [Force IP: Auto]; MLSD: Auto [List all: Auto]; HOST: Auto
. 2018-01-15 16:18:24.884 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2018-01-15 16:18:24.884 Cache directory changes: Yes, Permanent: Yes
. 2018-01-15 16:18:24.884 Recycle bin: Delete to: No, Overwritten to: No, Bin path:
. 2018-01-15 16:18:24.884 Timezone offset: 0h 0m
. 2018-01-15 16:18:24.884 --------------------------------------------------------------------------
. 2018-01-15 16:18:24.885 Connecting to xxxxx.xxxxx.co.nz:nnnn ...
. 2018-01-15 16:18:24.903 Connected with xxxxx.xxxxx.co.nz:nnnn. Waiting for welcome message...
< 2018-01-15 16:18:24.914 220-FileZilla Server 0.9.60 beta
< 2018-01-15 16:18:24.914 220-written by Tim Kosse (tim.kosse@filezilla-project.org)
< 2018-01-15 16:18:24.914 220 Please visit https://filezilla-project.org/
> 2018-01-15 16:18:24.914 USER PXESync
< 2018-01-15 16:18:24.925 331 Password required for pxesync
> 2018-01-15 16:18:24.925 PASS *********************
< 2018-01-15 16:18:24.937 230 Logged on
> 2018-01-15 16:18:24.938 SYST
< 2018-01-15 16:18:24.949 215 UNIX emulated by FileZilla
> 2018-01-15 16:18:24.949 FEAT
< 2018-01-15 16:18:24.966 211-Features:
< 2018-01-15 16:18:24.966 MDTM
< 2018-01-15 16:18:24.966 REST STREAM
< 2018-01-15 16:18:24.966 SIZE
< 2018-01-15 16:18:24.966 MLST type*;size*;modify*;
< 2018-01-15 16:18:24.966 MLSD
< 2018-01-15 16:18:24.966 UTF8
< 2018-01-15 16:18:24.966 CLNT
< 2018-01-15 16:18:24.966 MFMT
< 2018-01-15 16:18:24.966 EPSV
< 2018-01-15 16:18:24.966 EPRT
< 2018-01-15 16:18:24.966 211 End
> 2018-01-15 16:18:24.966 CLNT WinSCP-release-5.11.1
< 2018-01-15 16:18:24.977 200 Don't care
> 2018-01-15 16:18:24.977 OPTS UTF8 ON
< 2018-01-15 16:18:24.988 202 UTF8 mode is always enabled. No need to send this command.
. 2018-01-15 16:18:24.988 Connected
. 2018-01-15 16:18:24.988 --------------------------------------------------------------------------
. 2018-01-15 16:18:24.988 Using FTP protocol.
. 2018-01-15 16:18:24.988 Doing startup conversation with host.
> 2018-01-15 16:18:24.989 PWD
< 2018-01-15 16:18:24.999 257 "/" is current directory.
. 2018-01-15 16:18:25.000 Getting current directory name.
. 2018-01-15 16:18:25.000 Startup conversation with host finished.
< 2018-01-15 16:18:25.000 Script: Active session: [1] PXESync@xxxxx.xxxxx.co.nz
> 2018-01-15 16:18:25.002 Script: synchronize local -filemask=|astamp.dat -delete -transfer=automatic d:\serva_repo /serva_repo
*****

Reply with quote

Advertisement

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

Re: "Access is denied" for local delete during synchronize

So when you are logged in with DITSUPPORT\DIT account, can you delete the folder with a simple command-line rd command?

Reply with quote

Guest

Re: "Access is denied" for local delete during synchronize

Very good question, Martin - I haven't tried to delete from cmd, only explorer. Now having tried as you suggest, it says access denied. When I create a new folder manually in the same location (using explorer), permissions from the explorer properties security are identical, but using attrib /d /s, the "rogue" src folder displays as R, whereas the manually created folder does not - no attribs returned for it. Obviously that is the problem

You have given me a good lead to follow, now to find out why cmd attrib is different from the explorer gui security properties.

Reply with quote

Guest

RESOLVED - Re: "Access is denied" for local delete during synchronize

Thanks again Martin, for the lead. Still don't know why the difference, but I have solved my problem by putting an attrib -r command in my batch file that runs the winscp script. Works a treat.

Cheers.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum