I have one application on elastic beanstalk and cron jobs for it.
The code of setting cron is
container_commands:
01_some_cron_job:
command: "echo '*/5 * * * * wget -O - -q -t 1 http://site.com/cronscript/' | crontab"
leader_only: true
This script calls the mail sender. And I'm receive two message per time.
code of http://site.com/cronscript/
looks like (php code)
require_once('ses.php');
$ses = new SimpleEmailService(EMAIL_SHORTKEY, EMAIL_LONGKEY);
$m = new SimpleEmailServiceMessage();
$m->addTo('user@domain.com');
$m->setFrom('response_service@domain.com');
$m->setSubject('test message');
$m->setMessageFromString('', 'message content');
$send_emails=($ses->sendEmail($m));
When I call http://site.com/cronscript/
from browser's address bar, I receive one message as I want.