Script for automatic deletion of trash file of mail server


 
Thread Tools Search this Thread
Operating Systems Solaris Script for automatic deletion of trash file of mail server
# 1  
Old 09-20-2007
Script for automatic deletion of trash file of mail server

Hi,
I have a mail server with limited space and operating system is sun solaris 8 (sparc). I do not have provisions to increase the space for home directory.

So i have to delete files from /home/username/mail/trash which are more than 10 days old automatically.

So my script should be like it finds all the user name of mail server from /var/mail directory and then delete their trash from /home/username/mail/trash.

Can someone help me to generate a script for this?

With Regards,

Crown
# 2  
Old 09-20-2007
Hammer & Screwdriver Try this one

find /home/username/mail/trash -type f -atime +10 -exec rm -f '{}' \;


~~~Sanjay Tripathi~~~
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Deletion of list of user based on a text file In LDAP UNIX server

Dear All, It would be really nice, if you could help me to write a script for deletion of list of user( more than 15000 users) stored in a file and sorted by email address( i need deletion of only a particular type of mail address). Is the any script to write and take the file as input and... (3 Replies)
Discussion started by: Chand
3 Replies

2. Open Source

Shell script file movement to a Mail Box server using ftp commands

Hi All, I have a current Process that runs "windows script " for the file movement that needs to changed to a "DataStage Process (Using shell script )" Source :Text file is getting generated as part of Datastage Jobs processes and resides in a shared drive (Unix server) Target :ftp... (2 Replies)
Discussion started by: developer.dwh9
2 Replies

3. Ubuntu

Automatic update script issue (Ubuntu server)

Hi, I've created a very basic script to run apt-get update and apt-get dist-upgrade unattended (run with cron) and save the logs. Though, it's not really a script, just a file containing the commands to run in order: pasteit .com/18601 I'm currently testing this and ran into some unexpected... (4 Replies)
Discussion started by: Raxje
4 Replies

4. Windows & DOS: Issues & Discussions

Configure automatic script in windows server

Dear Experts, I have database running,on windows server 2003 and my database are going down frequently due to some oracle bug. I need help to configure the automatic script which run's and check the database status, if database is down then send me email. Thanks in Advance. (32 Replies)
Discussion started by: Mohammed Fareed
32 Replies

5. Shell Programming and Scripting

Shell script for sending automatic email to personal mail id

hi guys, I need a shell script to send mail automatically to my personal mail id like xxxx@hotmail.com but while experimenting with "mail" command I faced following problems. cat text1.txt | mail -s 'test mail' xxxx@hotmail.com command successfully executed but while checking for... (4 Replies)
Discussion started by: rrd1986
4 Replies

6. Solaris

Script for automatic deletion of old folder

Hi, I have a folder with limited space. So i have to delete folder which are more than 5 days old automatically. So my script should be like delete the folder more than 5 days old. Can someone help me to generate a script for this. Thank you... Cheer Summer (5 Replies)
Discussion started by: summerpeh
5 Replies

7. Shell Programming and Scripting

Script for automatic deletion of old files

Hi, I have a folder with limited space. I do not have provisions to increase the space for this folder. So i have to delete files which are more than 1 month old automatically. But, i need to maintain the files created by 4 users and delete all the other files automatically which is more than 1... (4 Replies)
Discussion started by: vivek_scv
4 Replies

8. Shell Programming and Scripting

Mail Command for deletion

How do i delete a mail i have just read using the mail command in a shell script ??? Thanks .... (0 Replies)
Discussion started by: garric
0 Replies

9. Shell Programming and Scripting

File deletion when server restarts

Hi, In a shell script I am makin use of 3 files f1,f2 and f3.txt. When the Unix server is restarted I want to delete all these 3 files if they are existing. ( I suppose I will have to use this command rm /thefilepath/f* but dont know in which script to use.) Anyone knows what can be... (6 Replies)
Discussion started by: k_oops9
6 Replies
Login or Register to Ask a Question