Store cron log in timedate file
I have this code currently:
echo "20 0 * * * cd /var/www/test/ && ./prog >> /var/log/program.log" >> mycron
This works great, but now I want to store it in a file at time intervals each time in a format like this:
program_YYYYMMDD_HHMMSS.log
Can anyone tell me how I can do this? I think I need to use a date variable, but I'm not sure how to implement it.
+3
source to share