Link to home
Start Free TrialLog in
Avatar of pradeep_jmd
pradeep_jmd

asked on

Automated backup script for daily, weekly and monthly

HI,
Could anyone help me out to create shell backup script for mysql databases.

Please find following condition needs to be include in script:

(1)Creating a automatic MySQL database backup daily
(2)At the end of the week, creating a weekly backup
(3)At the end of the month, creating a monthly backup
(4)Storing backups as compressed files(tar.gz) to save space (upto 90% space-saving)
(5)Deleting old daily, weekly, and monthly MySQL database backups – lets you define what is old:
(i) save daily backup like day.sql.tar.gz(Sun.sql.tar.gz):delete old one when find same day on next week
(ii) take weekly backup on every Saturday(keep 4 weeks backup): delete older then 4 weeks
(iii) take monthly backup on last day of every month(keep last 3 monthly backups):delete older then 3 months

NOTE: needs to take backup of all databases as separate dump not in single backup set

Suggestion: Also please made suggestions on how to take incremental backups in mysql(means take the full backup on start of week and then only take incremental backups..etc)


Thanks,
Pradeep
Avatar of pradeep_jmd
pradeep_jmd

ASKER

Hi,
Also please provide details with automates script for:
(1) Full backup on every Monday for each databases on seperate dump file
(2) Differential backup then after till Sunday
(3) Also provide incremetal backup after full backup
(3) When next full backup done on Monday it delete old one


Thanks,
Pradeep
ASKER CERTIFIED SOLUTION
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
(No points) just want to +1 what has been said and if you are in need of a good backup solution then a 3rd party software dedicated this is the way to go.  Especially if it is part of a larger backup scheme with tape or other media.
Hi,
I just need script for automation of my backup, daily, weekly and monthly.


Thanks,
Pradeep
HI,
Our database consists InnoDB and MyISAM tables.

I need the script to take full backup weekly and incremental backup then after.

Also provide script for to take differential backup.

and how to restore from full backup and incremental backup if database crash during weekdays.


Thanks,
Pradeep
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
How big is your database? If you've got the space do a full backup every Night regardless, if not, buy a big enough hard drive and do the same thing.  If you're data is important don't stuff around with incremental. Do a full backup as storage is cheap.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for all suggestions.

Just give me some idea about:

(1) Do full backup on each week on SUNDAY at once
(3) Then Monday To Saturday Differential backups using diff

(3) and how to restore during weekday with the help of weekly full backup and differential backups

Please provide me example script then i can take it up too write for our databases.

Thanks,
Pradeep
Have a look at @routinet's comment above: http:#a39568258.  It describes what you need to know.  No point reiterating it.