FileNotFoundError: [Errno 2] No such file or directory: 'hdfs': 'hdfs' using subprocess popen in crontab FileNotFoundError: [Errno 2] No such file or directory: 'hdfs': 'hdfs' using subprocess popen in crontab hadoop hadoop

FileNotFoundError: [Errno 2] No such file or directory: 'hdfs': 'hdfs' using subprocess popen in crontab


I had similar problem when my script executed by Airflow in the same machine, Airflow did not load my environment variables. I had to manually set the environment variables in code. you can find how to do that in code here. just update PATH to include Hadoop binaries path. also it is suggested that you can load environment variables in cron job script. like:

#!/bin/bashsource $HOME/.bash_profilesome_other_cmd

more details