# backup script using sqldump and table files

**URL:** <https://forums.percona.com/t/backup-script-using-sqldump-and-table-files/1541>\
**Category:** Other MySQL® Questions\
**Created:** [October 26, 2010, 8:02am UTC](https://forums.percona.com/t/backup-script-using-sqldump-and-table-files/1541 "2010-10-26T08:02:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iberkner](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@iberkner](https://forums.percona.com/u/iberkner)\
**Post date:** [October 26, 2010, 8:02am UTC](https://forums.percona.com/t/backup-script-using-sqldump-and-table-files/1541/1 "2010-10-26T08:02:04Z")

</div>

Hi,

I’m looking for a bash backup script that will do the following:

1. Use mysqldump to dump the data into individual files, one for each table.

2. Tar and compress the dump, removing the individual files.

3. Store the tar file using a date format, something like “backup-yyyymmdd”.

4. Remove files that are 7 days or older

I’m familiar with mysqldump, less familiar with using bash.

---

<div class="post-metadata">

**Author:** ![iberkner](https://avatars.discourse-cdn.com/v4/letter/i/c67d28/32.png) [@iberkner](https://forums.percona.com/u/iberkner)\
**Post date:** [October 26, 2010, 10:36am UTC](https://forums.percona.com/t/backup-script-using-sqldump-and-table-files/1541/2 "2010-10-26T10:36:49Z")

</div>

Found this article which is pretty close to what I’m looking for.

[URL=“http&#58;&#47;&#47;[forum.slicehost.com/comments.php?DiscussionID=2758](http://forum.slicehost.com/comments.php?DiscussionID=2758)”][/URL]

[URL][http://forum.slicehost.com/comments.php?DiscussionID=2758[/URL]](http://forum.slicehost.com/comments.php?DiscussionID=2758%5B/URL%5D)
