Answer the question
In order to leave comments, you need to log in
How to give cron write and read permissions?
Good afternoon!
Tell me, how to give cron permissions to write / read a file on Debian?
Part of the script where the problem occurs:
if (is_writable($dir_url)) {
mail('[email protected]', 'OK', "mogy zapisat!");
} else {
mail('[email protected]', 'Err', "ne mogy zapisat!");
}
if (is_readable($dir_url)) {
mail('[email protected]', 'OK', "mogy prochitat'!");
} else {
mail('[email protected]', 'Err', "ne mogy prochitat'!");
}
/usr/bin/wget -O - -q -t 1 XXX/xibo-alarm/index.php?name=27&url=../../../xibo... >/dev/null 2>&1
curl -s XXX/xibo-alarm/index.php?name=27&url=../../../xibo... >/dev/null 2>&1
wget XXX.XXX.XXX/vi-test/date-inspection/index.php >/dev/null 2>&1
Answer the question
In order to leave comments, you need to log in
crontab executes tasks on behalf of the user under which these tasks were given. And a web server, for example apache, already has its own user (for example www-data), and this user already has its own rights and group. So you need to look at the group and user rights under which you run cron tasks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question