Skip to content

Commit

Permalink
fix multiple cron tab service runner entries
Browse files Browse the repository at this point in the history
  • Loading branch information
glynhudson committed May 5, 2016
1 parent f711d40 commit 5e1c940
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion emoncmsupdate
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ echo "Checking cron tab for service runner entry..."
# Add root crontab entry to run wifi check script ever 5min
crontab -l > mycron #write out current root crontab
# Check crontab entry does not already exist, if not add new entry
if ! grep -Fxq " * * * * * /home/pi/emonpi/service-runner >> /var/log/service-runner.log 2>&1" mycron ; then
if ! grep -Fxq "* * * * * /home/pi/emonpi/service-runner >> /var/log/service-runner.log 2>&1" mycron ; then
echo "Add service runner cron entry"
echo "* * * * * /home/pi/emonpi/service-runner >> /var/log/service-runner.log 2>&1" >> mycron #echo new cron into cronfile
crontab mycron #install new cron file
Expand Down

0 comments on commit 5e1c940

Please sign in to comment.