ntrsboy
asked on
How to create dateandtimestamped and gziped backup script
I have a database called 'database1' in/var/lib/mysq/database1. A want to backup that database every day via cron. Basicly I need a script who will backup my database every day and I would like the file created from the backup to be dateandtimestamped and gziped which means to have a backup files with time stamp such ymd. For examle let say if today is 17/07/2006 is i need the file to be called something like something like db_060717.gz .
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Create the following script, and add it to your crontab:
#!/bin/bash
mysqldump db_name | gzip -c > /var/lib/mysql/backup/$(da
Cheers!