Cron for deleting folder is not working

fabioweb90

Verified User
Joined
Feb 20, 2022
Messages
41
Hello! while trying to understand the reason of msglog is going to full diskspace i setup following cron but are not working
and i have to delete manually by FTP all the content. what is wrong in attached command?
Regards
 

Attachments

  • Immagine 2022-02-27 205743.png
    Immagine 2022-02-27 205743.png
    27.4 KB · Views: 96
Inside the panel you are in the "admin" users Cron.

You need to ssh in to the server as root and build them as root cron jobs
 
Thanks! i open directly the path: /var/spool/cron
Is this fine?
 

Attachments

  • Immagine 2022-02-27 233430.png
    Immagine 2022-02-27 233430.png
    22.3 KB · Views: 84
You probably shouldn't blindly delete data in /var/spool, you will risk losing e-mail you actually want. Instead use mechanisms to manage the exim mail queue.
 
Thanks @kristian you right i need to understand the issue and this is a temporary fix. However i can delete email because i have another server as SMTP email.
Reading this thread i have to run first sudo crontab -e
then i can run: 30,* * * * * rm -rf /path-to delete
Am i right?
 
Instead of rm, you should use exim itself to delete message from the queue. E.g. exim -bp to show the queue. Find the message id of a message and then exim -Mrm <id> to delete that mail. Based on the information in the queue, you can choose to delete messages based on to, from, size, age, or something else.

There are also other tools like exiqgrep that might be useful for you.
 
Back
Top