I need to send continuous mails, say one every minute, for testing purposes from a server running postfix.
With the mail
command I can manually do it, although there is no specific option to trigger it to auto send mails.
Asked
Active
Viewed 746 times
1

nicoX
- 1,142
- 3
- 13
- 25
-
1You need to set up a cron job: http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job – labarna Oct 22 '13 at 13:11
1 Answers
1
I think the best way to do this is via a cron job. Type crontab -e
in a terminal (you have to be root).
And add a line with the following content:
* * * * * /bin/echo "content" | /usr/bin/mail -s "subject" email@provider.tld
And save the file. It will send every minute a mail. After that restart the cron daemon:
service cron restart
See cron for how to set other time scheduling.

chaos
- 27,506
- 12
- 74
- 77
-
One does NOT have to be
root
to usecron
! Readman crontab
especially about/etc/cron.allow
– waltinator Nov 11 '17 at 21:49