I’ve been setting up backup and mirror jobs between my MBL and my local drive, based on robocopy.
I’m running up against issues in a situation where the backup script needs to change an attribute of the files on the MBL. This happens when when I use the Archive attribute bits of files in order to keep track of what has been backed up and what hasn’t (the robocopy option /M is relevant here).
The trouble comes when I run the script as me (I have admin privileges), and the backup script is backing up another user’s files from the MBL to the local drive. Now, on the MBL I have read and write access to all users’ shares, so accessing those files for backing up is not a problem.
The problem comes when robocopy tries to reset the Archive attribute bit of a file on the MBL after backing it up. In particular, where that file was created by another user on the MBL other than me. Robocopy gives an Error 5 – access not permitted – error when trying to update the file attribute.
This is a long-winded way of saying:
Although I have read / write access to all other users’ files on my MBL, and can edit / delete any file created on the MBL by any user, I do not seem to be able to change the file attributes of any file which wasn’t created by me.
This seems a bit off – I can edit / trash another user’s file, but I cannot change a file attribute for that file.
Is there any way around this? Preferably a way in which I can force an appropriate level of authority on the robocopy command (and the attrib command) to allow it to change the file attribute of another user’s file?