M
M
MarkTanashchuk2020-09-16 18:49:14
Flask
MarkTanashchuk, 2020-09-16 18:49:14

Why doesn't cron run a bash script?

I have a bash script that edits a text file every few minutes, and if I run the script manually, everything works correctly, but for some reason, crontab -ewith this entry:

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
15 *   * * * /var/www/script.sh >/dev/null 2>&1


The task is not processed every 15 minutes

What could be the problem and what is the correct way to run a bash script from cron?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2015-10-15
@fastie4

python 3

R
Ronald McDonald, 2020-09-16
@MarkTanashchuk

15 * * * * /var/www/script.sh >/dev/null 2>&1
Try:

15 *   * * * /bin/bash /var/www/script.sh >/dev/null 2>&1

Pusho I'm not sure if your PATHs will be processed by Cron.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question