PDA

View Full Version : End of School Year Student Folder Purge ?




Semio1es
Jun 5, 2009, 09:06 AM
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
Jun 5, 2009, 09:20 AM
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
Jun 5, 2009, 09:52 AM
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
Jun 5, 2009, 10:23 AM
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
Jun 5, 2009, 11:31 AM
"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).

xparaparafreakx
Jun 5, 2009, 02:07 PM
I was going to say just make new users on WGM.

I am going to have to do that next week.

Semio1es
Jun 5, 2009, 07:59 PM
"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!!