It is possible to delete all Users .Trash files
First you need to establish
1. Do you really need this? What if someone accidently deletes something and wants to get it back they can't get it back the next day
2. If my method works for you by test test and test before going live with this
Ok now i've got that off my chest here we go.
There are many ways of doing this from Applescripts, Applescript applications, user login hooks with workgroup manager, third pary applications like Onyx or Cocktail or via unix commands via a script
I have chosen to use unix command via a bash script via other methods
because
1.Applescripts can get over complicated, and Applescripted application rely on a user double clicking it and whats the point of that.
2.Forced workgroup manager login and other settings don't always work and are not reliable enough to get the job done
3.Applescripted applications at forced login may cause the system to freeze with the spinning beach ball of Death (SPOD)
4.Third party applications can be risky because you don't know what they are doing to your system and blindly clicking away is dangerous.
Instead i use the daily task found in /etc which in MAC OSX runs after 3am in the morning. I create a daily.local file because after the daily task is run the system recognises there is a another daily task to run and then straight away carries on to do the daily.local
HOW TO CREATE THE DAILY.LOCAL FILE
1.Open terminal found in /Applications/Utilities
2.Switch to root user (make sure you have root user enabled) by sudo su and type in the password
3. In the terminal window type
cd /etc/
4.type the following which will create the blank file
touch daily.local
5. type
vi daily.local
6.Press "i" for insert
7.type
#!/bin/bash
# Empty all User Trash Files
sudo rm -rf /Users/*/.Trash/*
# End
8.Press "Escape"
9. hold the "shift key" down and press ":"
10. then type wq! and press enter which is saying write and quit
11. then type
chown root:wheel daily.local and press enter
12. Then to make it executable type
chmod 755 daily.local and press enter
13. Thats it set the machine to wake at 3am and shut down later something like 6am and if you have workgroup manger you can do it from that and all the User .Trash files will automatically delete in the early hours of the morning without you having to do anything.
You can distribute the daily.locl file through Apple Remote Desktop or see my other thread here to package it up using xcode tools and Composer i used Composer 5.1 (the only version to retain resource and file forks)
http://www.mozdev.org/pipermail/systemproxy/2008-December/000007.html
you can use the daily.local task to carry out other task at night as well. Here is mine which does the following
1.Carries out a clean up script
2.Repairs Disk Permissions on the disk
3.Removes all user .Trash files
4.carries out a sophos antivirus scan of the disk
5.Sets the software update server to my dedicated xserve
6.Installs all of my authorised apple software updates
-----------------------
# Run cleanup script
echo "Running cleanup script"
sudo sh /Library/Scripts/.cleanup.sh
# End cleanup script
# Begin Repair Permissions Script
PATH=/bin:/sbin:/usr/sbin:/usr/bin:/usr/libexec
export PATH
host=`hostname -s`
echo "Repairing Permissions on System Drive"
diskutil repairPermissions /
# End Repair Permissions Script
# Remove all User Trash Files
sudo rm -rf /Users/*/.Trash/*
# End Removing Trash
# Begin Sophos Sweep
sweep / --quarantine -exclude /Library/Management/Triggers
# End Sophos Sweep
# Set Softwareupdate Server
defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL
http://xxx:8088/index.sucatalog
# End Setting SoftwareUpdate Server
# Begin Software Update
softwareupdate -i -a
# End Software Update