I am trying to backup mysql database with mysqldump.
/Applications/MAMP/Library/bin/mysqldump
--opt --user=user--password=pass Database>
/Applications/MAMP/backup/data.sql
I would like the filename to have the current date/time (upto second is okay) in the filename. My data.sql should be data<current date/time>.sql. (or from epoch is okay too).
I know I can get current time by using date +%s but how do I use it as a filename.
I’m using MacOSx
In
bash, you could just dump to