I have the following code:
mysqldump -u root -h localhost -ppassword --all-databases > work.sql
I want the name of the sql file to be dependent on a variable.
My complete program is as follows:
#!/bin/bash
mysqldump -u root -h localhost -ppassword --all-databases > backup$time.sql
megaput --path /Root/Website/SQL/ backup$time.sql
rm backup$time.sql
I want to be able to replace $time
with the current time and date when this file was ran. Is this possible, if so how?