Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Semio1es

macrumors member
Original poster
Jul 10, 2008
86
0
How would I purge the contents of the student folders on our Xserve. We want to keep the folders but delete the contents in the user folders.

We would want to remove the contents in:

~/Desktop
~/Documents
~/Library
~/Movies
~/Pictures
~/Music

Is their a script to accomplish this?

Please don't tell me that I need to do this manually!
 

Chris R

macrumors newbie
Jul 18, 2008
5
0
How would I purge the contents of the student folders on our Xserve. We want to keep the folders but delete the contents in the user folders.

We would want to remove the contents in:

~/Desktop
~/Documents
~/Library
~/Movies
~/Pictures
~/Music

Is their a script to accomplish this?

Please don't tell me that I need to do this manually!

Maybe a dumb question, but why not remove all folders, and use WGM to re-create the home folders?

Best,

-Chris
 

wrldwzrd89

macrumors G5
Jun 6, 2003
12,110
77
Solon, OH
I suggest simply obliterating the entire user home folder (which will achieve your goal, as well as clearing out any custom folders users may have created outside those 6 folders) then using Workgroup Manager to recreate them, like Semio1es suggested. That way, you'll not only restore the default settings, but also free up space as well as clear out unused files.
 

Semio1es

macrumors member
Original poster
Jul 10, 2008
86
0
How do I delete them? Do I need to do it thru terminal? I tried to delete one and it did not delete? Is this a permissions issue?

Will the folders automatically create when the user logs into the network/server?

Or do I need to recreate the folders manually in WGM?

We are using mobile accounts.
 

Chris R

macrumors newbie
Jul 18, 2008
5
0
"How do I delete them? Do I need to do it through terminal? I tried to delete one and it did not delete? Is this a permissions issue?"

Many ways. One way is to select all of the folders using the Finder, open terminal and use the command, sudo rm -Rf (then drag the folders into the terminal window). Remember to leave a space after you type f.

"Will the folders automatically create when the user logs into the network/server?
Or do I need to recreate the folders manually in WGM?
We are using mobile accounts"


-If the users are all in the same root folder, then you can simply go into WGM, select all of the users, click on the home tab and tell WGM to create new home folders. Click save to finish the operation.

*** Be careful using sudo rm -Rf. It will delete everything you specify without question (after you enter in an admin password).
 

Semio1es

macrumors member
Original poster
Jul 10, 2008
86
0
"How do I delete them? Do I need to do it through terminal? I tried to delete one and it did not delete? Is this a permissions issue?"

Many ways. One way is to select all of the folders using the Finder, open terminal and use the command, sudo rm -Rf (then drag the folders into the terminal window). Remember to leave a space after you type f.

"Will the folders automatically create when the user logs into the network/server?
Or do I need to recreate the folders manually in WGM?
We are using mobile accounts"


-If the users are all in the same root folder, then you can simply go into WGM, select all of the users, click on the home tab and tell WGM to create new home folders. Click save to finish the operation.

*** Be careful using sudo rm -Rf. It will delete everything you specify without question (after you enter in an admin password).

Thank you, that worked just great!!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.