Edubuntu Update Part 3


One of the last things on my to do list is to set up some sort of “Reboot and Restore” mechanism similar to what happens with deepfreeze. While this little script doesn’t do all of that, along with good file permission set up, it does a good job of restoring user accounts to a “steady state.” I have it running on my test server (my laptop.)

After creating user accounts and setting them up as you would like them, (I used Sabayon to set up and lock down my user accounts.), you can use a command like this to create the files to restore from:
cd /home
tar cvfz restore_patron1.tar.gz patron1
tar cvfz restore_patron2.tar.gz patron2
tar cvfz restore_patron3.tar.gz patron3
tar cvfz restore_patron4.tar.gz patron4

And so on with additional lines for each public account.
Next you need to have a script that will remove the files in the user directory and copy the restore version back into that directory. So:

cd /home
rm -fR /home/patron1
rm -fR /home/patron2
rm -fR /home/patron3
rm -fR /home/patron4
tar xvfz /home/restore_patron1.tar.gz
tar xvfz /home/restore_patron2.tar.gz
tar xvfz /home/restore_patron3.tar.gz
tar xvfz /home/restore_patron4.tar.gz

I put this in /etc/rc.local so it runs every time the server is rebooted. I am considering running it as a cron job so I can have it go in the middle of the night without a daily reboot. If anyone knows of a good way for me to do this when each session logs in, without causing problems for accounts that are currently logged in, please let me know.

About ashkev

The Fiddling Librarian 3.0 is Kevin Smith’s personal weblog. Kevin is a recent graduate with an MLS from IUPUI. Kevin is the Assistant Director of the Cass District Library which is in Cass County Michigan.
This entry was posted in Uncategorized. Bookmark the permalink.