Answer the question
In order to leave comments, you need to log in
How to run cron on centos7?
So I wrote it in the file, but nothing is updated, how to start updating by cron correctly?
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# For details see man 4 crontabs
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
01 * * * * root /usr/bin/php -f /var/www/html/mysite.ru/public_html/update.php
Answer the question
In order to leave comments, you need to log in
1. In which file, in which folder are you trying to set this task?
2. If you set the task via crontab -e, then you do not need to write the user from which the task is launched. It will be run from the user from which the command was launched, or from the one that will be specified in the -u switch.
3. Are you sure you need to run this as root? In fact, judging by the task, you need to run it from a non-privileged user. Most likely from the same one under which the site scripts are launched (I hope they do not work as root?).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question