A bash script to automate MySQL database dumps with customizable filename prefixes and timestamp patterns. This script dynamically generates the dump file name using the format:
<prefix>_<env>_YYYYMMDDHHmmss_TIMEZONE.sql
- Customizable filename prefix (PREFIX) to identify your app or backup purpose.
- Timestamp format includes the current date, time, and system timezone.
- Measures the time taken to create the backup.
- Outputs the file size of the dump.
- Securely prompts for the MySQL password (no password hardcoding).
- Replace
<host>
,<user>
,<db_name>
,<env>
, and<app_name>
with your own values. - Run the script to create a timestamped SQL dump of your MySQL database.