Startup script to clean out trash can

I need to know how I would be able to clean out the trash can of a single "dumb" user every time the MAC is turned on.

Back ground.
OS 10.3x
G3 Mac
Two users configured...
1) Root or Admin (superuser)
2) student (Simple no access to anything but shared folder for files etc.)

The problem is student's keep deleteing items from the itunes area and the trash can fills up and gives system warnings about the trash getting to full ie /tmp 100%....

It would be great if I could create a startup script the deletes the trash for the user and modify the startup some how for this....

I know a little unix but never played with MAC's before

Thanks in advance

May be cron is a better solution?

Thanks...
I will look around the OS and....

A gui solution would be:

Compost
automatic trash management
http://www.mac-compost.com/

Cheers,
verno

A login or logout hook could do this pretty easily.
Check out bombich.com for information about login/out hooks.

Basically the login hook mechanism puts the username into $1.
In pseudo code, the code to add to the login hook would go:
If "$1" equals studentusername
then rm -r /Users/studentusername/.Trash/*
End If

The system runs login hooks with root privs, so there should not be any access problem for the directory.
Admin privs (sudo) are required to add or remove login/out hooks. The script should be rwx for root only and stored in a directory with, at best, only root access.

A login or logout hook is really just a preference setting that points to a script to run (if I recall correctly). Well, that and some code some where responsible for passing the username to the script. :smiley:

It should be said that the root account does not have to be enabled at all to create and use this hook functionality.
It can be a pretty powerful tool, and as with all powerful tools, test, test, test, then implement. :wink: