V
V
Vladimir Revyakin2016-07-14 16:36:48
Task Schedulers
Vladimir Revyakin, 2016-07-14 16:36:48

How to execute script in cron in centos 7?

The task is to execute a cron script like https://test.com/cron/sendEmails
In the root file along the path /var/spool/cron I wrote: */1 * * * * https://test.com/cron/sendEmails > /dev/null 2>&1
Everything seems to be running in the logs
CentOS-72-64-minimal CROND[2590]: (root) CMD ( https://test.com/cron/sendEmails >/dev/null 2>&1)
CentOS-72-64-minimal CROND[2595]: (root) CMD ( https://test.com/cron/sendEmails >/dev/null 2>&1)
But emails are not coming for some reason.
Most likely I'm not setting the execution parameters correctly.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
CityCat4, 2016-07-15
@jonimuesli

Commands are written in the crontab. You wrote something unknown. Cron receives your "command" as input and honestly writes somewhere in the log that the https command does not exist, that's all.

V
Victor, 2016-07-14
@estoy

And what kind of script is this " https://test.com/cron/sendEmails "? Try to execute it in the terminal and see what happens, in cron you need to either specify the path to the script in the system, or bash commands, not URLs!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question