7

I am programming some schedule task in my Ubuntu 16.04.

But when I try to start the crond.service by

sudo service crond start

I receive the message

crond.service
   Loaded: not-found (Reason: No such file or directory)
   Active: inactive (dead)

What's the problem? The tasks was added to the schedule by crontab command and look fine (the command works in the terminal, have the correct tree folder, I just added the day-hours parameters).

hildogjr
  • 754
  • 2
  • 6
  • 17
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/) or [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) would be a better place to ask. Also see [Where do I post questions about Dev Ops?](http://meta.stackexchange.com/q/134306) – jww Apr 07 '17 at 09:20

1 Answers1

35

It's because the service name on 16.04 is cron, not crond. So your command should be:

sudo service cron  start

You can verify on your server by looking in the /etc/init.d folder. All the services are there.

ls -l /etc/init.d
Benjamin W.
  • 46,058
  • 19
  • 106
  • 116
Vilmos
  • 516
  • 4
  • 8
  • YES, I realize that. Thanks. Just now, the cron try to execute the command and don't show any error despise not really execute. In the status is showed: Abr 06 12:18:01 h-lcee CRON[14155]: (h) CMD (python '/home/h/Documents/UNICAMP/Scripts Python/bandecoWarning.py') Abr 06 12:18:01 h-lcee CRON[14154]: pam_unix(cron:session): session closed for user h – hildogjr Apr 06 '17 at 17:13
  • If the command shows that it executed in the cron.log file then the command was run. Cron will only tell you it did or didn't run the command. It doesn't capture the result. You will need to look at the script you have written to make sure there are no error in it that would cause it to be exiting. Check your /var/log/syslog file at the time the command ran to check for errors. That may have some information to help you troubleshoot. – Vilmos Apr 06 '17 at 20:00
  • Not `systemd` now, instead of `init.d`? – geotheory Apr 07 '18 at 21:23