0

I'm building a script which helps me to re-build static sites every day when new content is updated on my CMS. For testing purposes, I'm trying it out on my local computer.

The script named helloworld.sh is

#!/bin/bash (cd /Projects/blog && gatsby build)

And I have edited crontab -e to that of

* * * * * /Projects/scripts/helloworld.sh

which gets it to run each minute just for testing purposes. However, it is not working and returns an error, No MTA installed, discarding output when I run service cron status. Which I looked up and it is regarding mailing output and that it supposedly should not affect what the script does at all.

Apr 30 23:05:01 unicornfinder CRON[12363]: (unicornfinder) CMD (/Projects/scripts/helloworld.sh)

Apr 30 23:05:01 unicornfinder CRON[12362]: (CRON) info (No MTA installed, discarding output)

How would I get this script to run? Thanks!

klutt
  • 30,332
  • 17
  • 55
  • 95
cake_lord_97
  • 51
  • 1
  • 8

1 Answers1

0

When there's an error on cron jobs and job output is not redirected to a file, cron tries to send an email to the user which in your case fails because there's no MTA. Edit your crontab

* * * * * /Projects/scripts/helloworld.sh >> /tmp/file.log 2>&1

LMC
  • 10,453
  • 2
  • 27
  • 52