0

My target is to create a file on a yesterday-date directory on HDFS via Azkaban. The command in the *.job file is as follows:

command=sudo -u hdfs hadoop fs -touchz /user/"`date -d '${etl_date} yesterday' "+%F"`"/_SUCCESS

The hadoop fs -touchz command can run correctly in Linux but Azkaban says it is wrong:

touchz: `/user/`date -d '2017-08-11 yesterday' +%F`/_SUCCESS': No such file or directory

How to address it? Any help is appreciated.

superz
  • 99
  • 1
  • 2
  • 10
  • Check the quotes in command, either escape quotes surrounding +%F as `\"+%F\"` or remove double quotes surrounding entire date -d command – Ravi Aug 11 '17 at 14:57
  • @Ravi Thanks for your reply, but this doesn't work as expected.. – superz Aug 14 '17 at 03:07
  • Any error you got with above would be helpful. – Ravi Aug 14 '17 at 05:08
  • @Ravi Thanks man, I resolved this problem by using "bash -c": bash -c "hadoop fs -touchz /user/`date -d '${etl_date} yesterday' +%F'`/_SUCCESS" – superz Aug 14 '17 at 09:01

0 Answers0