Is there any possibility to pass current date/time to command in my cron job? E.g. I want to make sql dump every night and name the dump file like 'dump-yyyy-mm-dd.sql'.
That would be something along the lines of:
mysqldump database > database-$(date +%F).sql
$() will embed the output of
date +%F, which is
YYYY-MM-DD into the command line.
Sgaduuw's answer does work (and I've upvoted it), but I usually encourage people to write scripts and call those from cron, rather than try and do too much in the cron command directly. Firstly, it allows you to easily test / enhance your script without having to mess with cron configuration, and secondly it allows you to be in better control of the environment in which your commands execute.