I've got a simple backup script that goes something like this...
OUTPUT_DATE=$(date +"%Y%m%d_%H%M%S")
LIVE_DATABASE=“MyDatabase”
FILE_DESTINATION=“~/apps/path/databases/dump_$OUTPUT_DATE.sql
mysqldump -u foobar -p123456 -h example.com -P 1234 $LIVE_DATABASE > $FILE_DESTINATION
But when executing the script, I get ~/apps/path/databases/dump_20230511_144827.sql does not exist
- which of course it doesn't, I'm trying to generate the file.
However, if I don't use a variable, but the filename like this, it works:
mysqldump -u foobar -p123456 -h example.com -P 1234 $LIVE_DATABASE > ~/apps/path/databases/dump_$OUTPUT_DATE.sql
What am I missing?