By codeview
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!
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
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.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.