Restoring a User profile upon reboot

Contributor III

I currently have a policy configured that when a machine is shutting down it removes a standard user profile that we use in our lab and installs a dmg of that profile from the server to /Users. This has worked well up to now. I would rather keep a dmg of this profile locally though and then when shutting down it just removes the profile that was being used, mounts the dmg, and then copies the contents as the new profile for the user.

Basically such a system allows for me not having to use a product called Deep Freeze which gets in my way for doing any maintenance in the background on the systems during working hours. It also easily allows for making tweaks to certain settings easily that can be rolled out in a lab setting. Like I said my current config has worked well up to now and I need to avoid pulling down that dmg profile on every restart.

Hopefully that's clear. I've tried bringing the dmg locally and use cp to copy the structure out but it seems to choke on acls. Someone suggested rsync but I had trouble there too. It's possible I'm just using the wrong syntax so any assistance would be appreciated.


Honored Contributor III
Honored Contributor III

@jhuls, you should be able to cache the DMG locally via 1 policy & then a second policy @ shutdown to install the cached version of the dmg.

Honored Contributor II
Honored Contributor II

I've had similar issues with rsync and cp in the past. I normally just get the data copied into place and then run a line or two in bash to sort out the ownership and permissions.

A cached package would work but I think it would delete the cached DMG once it's finished so you'd have to keep copying it back over.

Valued Contributor III

Why not just use the built in user template? populate /System/Library/User Template/english.lproj with the profile you want, then all you should need to do is delete the profile from /Users and when they log back in a proper new user profile should be created.
I guess if you need other users to log in and get something else this might not work...
If your worried about corruption of the template you could re apply it periodically from the network dmg directly using


Download deploy studio and use there already made homedirsFreeze included there dmg