java - Hadoop job fails when invoked by cron -
i have created following shell script invoking hadoop job:
#!/bin/bash /opt/hadoop/bin/hadoop jar /path/to/job.jar com.do.something <param-1> ... <param-n> & wait %1 status=$? if [ $status -eq 0 ] echo "success" | mailx -s "status: "$status -r "mail@mysite.com" "mail@mysite.com" exit $status else echo "failed" | mailx -s "status: "$status -r "mail@mysite.com" "mail@mysite.com" exit $status fi
when run above script manually this:
$ ./path/to/job.sh
hadoop job executes sucessfully , returns exit status "0".
now, automate job execution everyday, have configured cron job run above script this:
0 22 * * * /path/to/job.sh
but, job not submitted hadoop , exit status "1".
few things note here:
- the user account under cron job configured usera
- usera hadoop system user
- the cluster dedicated running job
- the script executable
i know why job not running when cron invokes ?
0 22 * * * /path/to/job.sh
i think lost "."
in command.
0 22 * * * ./path/to/job.sh
does work?
Comments
Post a Comment