[K12OSN] PostSession script, rm command and user directories

Nils Breunese nils at breun.nl
Fri Dec 15 11:52:04 UTC 2006

Meelis Mihhailov wrote:

> So every time a user ends his/her session, home directory will be  
> removed and replaced with the one in the tar file. (with the needed  
> permissions )
> This works fine but now as I'm setting up so called backup server  
> with LTSP 5, FC 5, Gnome 2.8 and Sabayon ... my solution won't work :(
> in the old system I have the following code that will erase the  
> home directory of a user who logged off :
> cd /
> cp /usr/BACKUP/terminal1.tar /home/terminal1.tar
> cd /home
> rm -R terminal1
> tar -xvf terminal1
> rm -f terminal1.tar

1) That "cd /" doesn't really do anything. But luckily it doesn't do  
any harm either.
2) I think "tar -xvf terminal1" should be "tar -xvf terminal1.tar"?

You could clean this up a little further, because it's not really  
necessary to copy the tar file, extract it and then remove it.

rm -rf /home/terminal1/*
cd /home
tar -xf /usr/BACKUP/terminal1.tar

Nils Breunese.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: Dit deel van het bericht is digitaal ondertekend
URL: <http://listman.redhat.com/archives/k12osn/attachments/20061215/494a09e4/attachment.sig>

More information about the K12OSN mailing list