This question already has an answer here:
I was not able to find the answer for this myself.
As cron uses /bin/sh, im getting Syntax error's. I have a cron job, which uses the following command in it
2,17,32,47 * * * * tar -czvf /opt/SOMEFILES /var/lib/$(date +"%Y/%m/%d")
2,17,32,47 * * * * tar -czvf /opt/$(date +"%Y/%m/%d")/somefiles /var/lib/$(date +"%Y/%m/%d")
Basically, this is just an example, the real cron job is a little different. Tried to give some type of an example.
$(date +"%Y/%m/%d") This is the part i am not sure how to use in Cron.
How could i use it in cron? the curdate could even be a folder where it goes.