Report this

What is the reason for this report?

Cannot get basic cron / cronjob to run (following the DO tutorial)

Posted on June 6, 2015

My droplet is running Ubuntu 14.04 and I am using ServerPilot to manage it (although I don’t think that matters for my question). I have followed the Digital Ocean tutorial for “how to use cron to automate tasks on a vps”, here: https://www.digitalocean.com/community/tutorials/how-to-use-cron-to-automate-tasks-on-a-vps

But I get nothing happening…no cronjob runs, no email sent. Can anyone help me with what to do next - to troubleshoot or what else to try? This is currently what is in my crontab (copied from the tutorial, just replaced the example email with my email):

SHELL=/bin/bash
HOME=/
MAILTO=”example@digitalocean.com”
#This is a comment
* * * * * echo ‘Run this command every minute’

EDIT: When I enter crontab with crontab -e the file location is listed as “/tmp/crontab.0aXfre/crontab”…could that location be the problem?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @NotEnoughSquirrels:

For safety reasons crontab -e opens in a tmp file, if it detects a problem it will not write to the actual crontab file. If there is no problem it will submit the new job, would comment out the MAILTO line and append the output to a log file then save the file and see what you get.

          • echo ‘Run this command every minute’ >> file.log Also I know it sounds silly but make sure cron is running

View the original comment

My crontab doesn’t seem to work

when i write “ps -ef | grep cron | grep -v grep”, it doesn’t show me any message I tried to write the command “service cron start” and it says Cron is already working I commented most of the commands and had a echo command but that also doesn’t show anything.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.