Get a date on Apache today

I want to use today's date in the output file path in one of my pig jobs, which is supposed to work daily, is there any way to do this. Something like /user/x/$todaysDate

+4
source share
1 answer

Do this with bash:

 echo '/user/x/'`date +%Y-%m-%d` 

gives:

 /user/x/2012-10-14 

So, you would execute your script as:

 $ pig -param outpath='/user/x/'`date +%Y-%m-%d` myscript.pig 

Then in your STORE command use $outpath :

 STORE abc INTO '$outpath'; 
+5
source

Source: https://habr.com/ru/post/1439708/


All Articles