The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Emails on HP-UX Phuti UNIX for Dummies Questions & Answers 0 03-26-2008 02:22 AM
Creating emails ferret495 UNIX for Dummies Questions & Answers 4 02-04-2008 10:13 PM
CRON. How to delete files within a directory southoxon UNIX for Dummies Questions & Answers 1 08-24-2003 07:55 AM
How do we delete spam email on mmdf esh UNIX for Dummies Questions & Answers 2 06-09-2003 06:48 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-29-2008
Registered User
 

Join Date: Jul 2008
Posts: 1
Delete Old Spam Emails Custom Cron

Hey Guys,

I've done some research however I got stuck. My goal is to create a cron job that runs every hour and goes through all web accounts on my server and deletes spam emails that are older than 3 days. This is what I came up with:

Code:
0 * * * * find /home/*/mail/*/*/.spam/cur/* -type f -mtime +3 -exec rm{}
HOWEVER ... when i test just a piece of that command:

Code:
find /home/*/mail/*/*/.spam/cur/* -type f -print |xargs ls|wc -l
I get the pretty "Argument list too long" error. I dont want to proceed setting up that cron job until I'm 100% sure that it is correct and will work on all user accouts with some of them having over 50,000 spam emails in ther .spam/cur folder. Any advice?
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 08:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0