AFP548

Logoutscript question

Group:

I use a modified version of Bombich's logout script to manage home folders on my lab machines. Lately I have noticed that user folders are not being archived at logout. In other words, the script does not appear to be executing under certain circumstances (which I cannot replicate).

Here is my script:

----------------------------------------------------------------------------

#!/bin/bash

uid="$USER"
home="/Users/$uid"
time=`date ''+%m-%d-%y_%H.%M.%S''`

if [ "$uid" = "infores" ]; then

rm -f /Library/Classic/Classic.dmg.shadow

exit 0

else

echo "Refreshing home directory."

rm -f /Classic.dmg.shadow

mkdir -m 755 "/private/tmp/$uid.$time"
mv $home "/private/tmp/$uid.$time"

fi

rm -f /Library/Classic/Classic.dmg.shadow

exit 0

----------------------------------------------------------------------------

"infores" is a local admin account, so I don't want to remove it.

The file is owned by root, group is wheel, permissions are rwx-r-x-r-x. It lives in /private/var/root/Scripts. Loginwindow.plist is modified accordingly.

Again, this works properly in almost all cases. However, it sometimes inexplicably refuses to run!

Any advice appreciated!

--Andy
Exit mobile version