Skip to main content

Cron Job auto delete emails older than X days in a domain

Comments

6 comments

  • cPanelMichael
    Hello :) The following thread should help: Having issues getting cron job to work Remember that values such as "mydomain" are referring to your actual domain name. Thank you.
    0
  • ahyde
    Thank you for answer :) and yes I replace USERNAME and MYDOMAIN.COM as my user name and the domain what I want delete all emails. I read the entry but did not work, I'm so newbie and I don't understand a lot the commands but I try. The path what I think is the correc for me is (because I see the path in my host server):
    /home/USERNAME/mail/MYDOMAIN.COM/*/
    because when I write the code previously put they don't send me error in the path, but in the command code after send me errors. I have been reading what mean each word in the commands but nothing I don't have idea why don't work :(
    0
  • cPanelMichael
    Do you see any output if you manually enter the "find" command? Could you send me a private message of the exact command you are using? Thank you.
    0
  • ahyde
    Sorry but I can't send PM, this error out: But anyway this is the code that I wanted send you :) The path what I think is the correct is:
    find /home/usernamehere/mail/example.com/*
    but the commands I don't know why don't works :( well, this are the commands what I used :
    find /home/mail/example.com/*/ -quiet -delete -days 30 find /home/mail/example.com/ -type f -mtime +7 -delete "quiet "delete "months 1 /home/iqmarkethink/mail/example.com/*/
    My user is:usernamehere and my domain: example.com Really thanks again for you help, I'm soooooooo newbie in this :oops:
    0
  • cPanelMichael
    Your "find" commands do not appear to use the correct paths. It's searching in "/home/mail" which is not a valid directory location. Thank you.
    0
  • mageshm
    Try the below url, it will work for you. Long time back, I have deleted manually and you can do the same via cron also. How to Delete Files Older Than x Days in Linux | 2daygeek.com
    0

Please sign in to leave a comment.