I currently redirect crontab script output to file in some folder that exists, like this:
echo "test" > `date "+/tmp/%Y%m%d_%H%M.log"`
I want to redirect output to subfolders, that maybe don't exists yet (
.../year/month/..., so subfolders should be created:
echo "test" > `date "+/tmp/%Y/%m/%d_%H%M.log"`
How can I accomplish this?