-1

I want to clear the Linux mail for my account every day at 10pm. How can I accomplish it?

bhattedon
  • 111
  • 2

1 Answers1

2

You could crontab -e to edit your personal list of cron jobs, and add the line:

0 22 * * * : > /var/mail/"$(whoami)"

which will, at 22:00 (10pm) every day, overwrite the file /var/mail/<your username> with empty data. If your mail file is stored somewhere else, you would need to change the path.