In my company, developers and testers are habitual to copy their files under /tmp rather than their home folders. At times, I used to see files of even in GBs. Inorder to bring this under control, I'm considering to write a script that can be run on a crontab for deleting all the unwanted user files in /tmp filesystem. Before developing a script, I want to get clarified with few questions about /tmp filesystem.
1. What files can be deleted from /tmp filesystem ?
2. How can I ensure that only user files are getting deleted (not files used OS) ?
3. What is the time limit (in days) I can set for a file to reside in /tmp filesystem ?
4. Finaly a straight forward solution: Can I restrict the users from coyping into /tmp filesystem and make only OS writes on it?
Please let me know ur suggestions. Thanks.