Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

automatic deletion of emails with cron

Discussion in 'E-mail Discussion' started by birken, Feb 13, 2017.

  1. birken

    birken Member

    Joined:
    Oct 28, 2013
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Reseller Owner
    Hi guys,

    i am using this cron job to delete old mails automatic on Horde.

    find /home/SERVER_LOGIN_USERNAME/mail/DOMAIN_NAME/MAIL_ACCOUNT_NAME/cur -type f -mtime +30 -exec rm {} \;

    what i wonder what to change in the code above if i want to delete mails that is older than 6 month?

    warm regards Birken
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,793
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The mtime value of "30" in that command represents the number of days. You could update the value from "30" to "180" days.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice