简体   繁体   English

cPanel中的Cron作业可在21天后删除电子邮件

[英]Cron job in cPanel to Delete Emails after 21 days

I'm having some issues with a cron job to delete emails after 21 days. 我的计划任务在21天后删除电子邮件时遇到一些问题。 I've read through many examples and have tried many different variations of this command but I can't get it to work: 我已阅读了许多示例,并尝试了此命令的许多不同变体,但无法使其正常工作:

find /home/cont/mail/ / /cur -name "*" -mtime +21 -exec rm {} \\; 查找/ home / cont / mail / / / cur -name“ *” -mtime +21 -exec rm {} \\;

Currently this runs and I get a message back from every mail box that doesn't have any files in the folder: "rm: cannot remove `/home/cont/mail/example.com/admin/cur': Is a directory" 目前正在运行,我从文件夹中没有任何文件的每个邮箱中收到一条消息:“ rm:无法删除`/home/cont/mail/example.com/admin/cur':是目录”

I then check the directories that do have files in them and nothing is deleted. 然后,我检查其中确实有文件的目录,并且没有任何内容被删除。 I'm sure I'm missing something simple... 我确定我缺少一些简单的东西...

Thanks. 谢谢。

I'm glad no one answered this and made me look even more stupid. 我很高兴没有人回答这个问题,让我看起来更加愚蠢。 It is working, the messages back are just because there are no emails but I am seeing the emails deleted from other user's folders now. 它正在工作,返回的消息只是因为没有电子邮件,但是我现在看到这些电子邮件已从其他用户的文件夹中删除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM