Remote hidden and read-only attributes from folders

pfarber22
pfarber22 used Ask the Experts™
on
I am using a program, FRP, to mirror user files to a remote server (both Windows 2003 R2s). Lately, I noticed that many of the folders on the destination server have hidden and read-only attributes (HS is shown in Windows explorer.
Resetting the attributes using attrib command works for a while and comes back to the hidden and read-only.
An interesting detail is that not every folder is having the problem. I can have a hidden folder with 25 hidden and 5 regular folders inside of it.
Needless to say that the folders are 'normal' on the original server.
Google seach point to a few programs that claim to be able to correct it. I wouldn't mind buying an inexpensive program but need to know if it reallly works.
The hosting company support cannot help, it does the same for them.
Any ideas on the cause of the problem and possible solutions would be appreciated
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
File attributes are applied to files and folders for specific reasons. One such reason is to protect them from being deleted, moved or overwirtten for example. Those files probably belong to a specific application or even the operating system. In some case, some user files may also br read-only or even hidden.

This is absolutely normal. If you don't understand the mechanics of this then you shouldn't be tampering with the system as you pose a threat to the integrity of those files by the very nature that you want to override their security settings without understanding why they were set in the first place.

There is nothing to prevent you from temporarily changing their settings if for example you need to move, delete, overwrite or view the files providing you respect the fact they need to be set back again. Although you might think this is an inconveniece it's something you must accept as normal.

If you don't believe what I'm trying to say here then do the foillowing on your XP PC:

   ATTRIB -h -r c:\ntldr
   DEL c:\*.*

Then, after rebooting, get yourself over to another PC (one which actually works) and let me know if you still want a general purpose program that will unprotect your files.



Commented:
I'm not familiar with frp, but it should have the options to copy ntfs attributes. However, it is quite possible that the file/folder attributes aren't being copied across for a number of reasons.

It sounds to me like attributes are being changed again whenever the mirror copy occurs. It may be inheriting the permissions and ACL information from the parent folders on the destination server.

I found robocopy does a reasonable job. Try running a robocopy with the mir (careful with mir), sec or secfix options. This may be all that's required. You can also change security settings with robocopy, here's a good technet article by the guy who wrote robocopy:

http://blogs.technet.com/filecab/archive/2008/07/31/robocopy-mir-switch-mirroring-file-permissions.aspx
Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015

Commented:
The creators of FRP should know how that happens. I cannot see any reason why FRP should hide folders not previously been hidden, and not being hidden on the source.

As there is no solution, you need a workaround. The workaround has to be applied each time FRP was in action. Sounds bad for me.
All workarounds will be based on the mechanism that robocopy uses, namely comparing file attributes of source and destination, and correcting those with /secfix option.

And that leads to the question: why not using robocopy in the first place? It can produce accumulating copies (deleted files remain in the copy) or exact copies (mirror, all file system changes are replicated including access lists, ownership, attributes, ...).
Acronis in Gartner 2019 MQ for datacenter backup

It is an honor to be featured in Gartner 2019 Magic Quadrant for Datacenter Backup and Recovery Solutions. Gartner’s MQ sets a high standard and earning a place on their grid is a great affirmation that Acronis is delivering on our mission to protect all data, apps, and systems.

Author

Commented:

The servers are in 2 different locations. I don't know if robocopy works over the Internet. FRP does a decent job similar to what Distributed File System Replication service or Double-Take do.
As far as what process changes the attributes, I believe FRP itself has nothing to do with it. It is either copying permissions from the host or destination (configurable).
 
Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015

Commented:
It is not "only" a backup which is created? If something can access the destination, it can change it. I do not know any reason why any software should change folder attributes. Even OS does not "repair" folder attributes itself. BTW, attributes HS are hidden and system (not readonly), and are only used for OS purposes.

If you really want to know, you have to record which program acts on the folder attributes. You could do so by using FileMon (www.sysinternals.com), filtered on one of those folders. You should make sure the folder is not accessed that often, else you get a lot of log entries.
Most Valuable Expert 2011
Top Expert 2011

Commented:

You cannot view or change the Read-only or the System attributes of folders in Windows Server 2003, in Windows XP, or in Windows Vista
http://support.microsoft.com/kb/326549/
Used to be a big problem. More often that not though, Windows Ignored the Read Only Attribute on the folder.
Are you having problems accessing the files though, or are you just curios about the "why is it happening"? I have no answer as to why some are affected and others arent though....
Commented:
okay, i've re-read the question.... This is indeed strange behaviour. Please ignore my first comment as it does not apply in this case - I misread the question believing it to be FRP that was controlling the affected attributes,

You say:

>>"Resetting the attributes using attrib command works for a while and comes back to the hidden and read-only"

>>"As far as what process changes the attributes, I believe FRP itself has nothing to do with it"

Can you confirm this by logging it's ativity using FileMon? Does FRP run as a scheduled task. If so, could you add FileMon to the sheduled just prior to FRP firing up. Set appropriate filters to isolate logging of the folders themselves (separated by the ';' character).

The aim is to discover what process is effecting the folders' attributes. If it IS FRP for some strange reason, your first call should be to contact the authors of FRP.

Also, if you discover it IS FRP that's altering the attrributes then, as part of the scheduled process, add code to reset their attrbutes back to what they should be. This is a simple enough operation and offers an immediate work-around to the problem.

Obviously, if it's another process that's effecting the attibutes (which going by your statement is the only other option) then this needs to be confirmed so that we can look at this from a different approach.
 





Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015

Commented:
I forgot to mention that those folder attributes do not have any effect for Windows (besides hiding), as johnb6767 stated correctly.

Commented:
Qlemo, shouldn't you be in church right now instead of loitering in the corridors of EE? :)

Author

Commented:
Thank you, this is a very good idea about FileMon. I will use it, even though I have some reservations about this process. What will it do if I monitor the folder which attributes were already changed. Unless I change them back to remove HS and start monitoring then. Even with this scenario, I am not positive that the problem will repeat on that particular folder. A significant number of folders makes monitoring difficult but I will do it anyway.
The reason I came across this issue was that I was monitoring the replication process and noticed that the were folders missing. Since the folders on the source server were "normal", it took me a while to discover that the "missing" folders had hidden and system attributes.
Except the fact that I had to enable the view of the hidden folders which will theoretically clutter users' view, I have a stubborn desire to bring the folders back to their normal view.
P.S. File Replication Pro does not use Windows scheduler, it is using its own management utility.
 
Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015

Commented:
With a little experiment you can see what you have to filter for in FileMon to see only attribute changes, if you can't isolate specific folders.

In ProcMon, the successor of FileMon (which will be no longer available after August), you can filter on "Detail contains Write Attributes". You might want to exclude FRP, if you do not think it is the culprit.

Commented:
Qlemo,

If it IS frp then It's easy to assume the attributes are altered as the files and folders are actually being copied from one location to another.

I can't see any reason why frp would want to change their attributes at a later time. And, I can't imagine why any other program would want to alter only selected attributes.

I would concentrate on monitoring the activities of frp and be certain of the result of that before looking elasewhere. Filemon MUST be the first consideration. Then I would come back here for further assistance.
Qlemo"Batchelor", Developer and EE Topic Advisor
Top Expert 2015

Commented:
"If you can eliminate everything impossible, it has to be the implausible"
- Sherlock Holmes -

I cannot image which application whatsoever would do that, too.

Author

Commented:
It was very difficult question and the real  reasons and  a solution may not even exist. Experts tried hard to answer, so I am assigning credits

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial