I've got a crontab job set to run minutely as such:
* * * * * /home/username/public_html/domain.tld/production/scripts/cron_runner.sh
My goal is to add some timestamps to output from cron so I can find things more easily with regards to some points of failure within a webapp's internal cron system. Sometimes I get messages and sometimes I don't it appears and I want to just perform a sanity check that I've built this script properly here:
#!/usr/bin/env bash
#
# Script Name: cron_runner.sh
#
echo "Cron Execution @ `date`: " >>/home/username/public_html/domain.tld/production/var/log/crontab_output.log 2>&1
cd /home/username/public_html/domain.tld/production && /usr/local/bin/php /home/username/public_html/domain.tld/production/cron.php >>/home/username/public_html/domain.tld/production/var/log/crontab_output.log 2>&1
echo "==== END CRON EXEC ====" >>/home/username/public_html/domain.tld/production/var/log/crontab_output.log 2>&1
Any suggestions?