0

we have a strange behavior , and I will explain

the following script run successfully on linux machine

su - hdfs -c "sudo /home/tasks.bash"

ps
  PID TTY          TIME CMD
32187 pts/3    00:00:00 ps
39256 pts/3    00:00:00 bash

but when we put the script in cron job as the following

more  /etc/cron.d/TASKS_JOB

*/1 * * * * su - hdfs -c "sudo /home/tasks.bash"

then script not executed ( script should run each 1 min )

what could be the reason for that ?

11
  • how did you configure the cronjob? crontab -e?
    – blissini
    Sep 13, 2020 at 20:51
  • this is cron file under /etc/cron.d
    – yael
    Sep 13, 2020 at 20:52
  • and the script should be run as user hdfs?
    – blissini
    Sep 13, 2020 at 20:54
  • 4
    You're running the cron entry as root, switching to the hdfs user, then having that user run the script as root??? Can you explain the logic here? Sep 13, 2020 at 21:03
  • 1
    syntax should be: * * * * * <user> <command>
    – blissini
    Sep 13, 2020 at 21:04

0

You must log in to answer this question.

Browse other questions tagged .