For a long time I though the AutoMySQLBackup project had died. Then, after I created many updates, in November of last year I saw some life. Meanwhile, I have continued to update the code and track what people have requested. Low volume project are sometimes hard to keep alive. People think the project is dead and don’t want to use code that will not see updates. Then if you make updates the authors may not come alive often enough to make the changes.
I have updated AutoMySQLBackup again. This time I have included the ability to make backups at the table level by including the table name, with the database name, in the list of databases to be backed up. Adding a ‘.’ between the database name and the table name (data.table) will backup only that table in the database. (IE DBNAME=”mysql test database.table”)
You can download my version here. automysqlbackup.sh.
Some of my improvements include:
- copy (rsync) the local backup files to a remote locations using the COPYDIR variable.
- option to copy files into a directory based on the host name using the variable HOSTNAME. This allows the script to be run from a shared storage directory ( SBM, NFS, NetApp) the data to be kept separate.
- option to backup the full schema only using variable FULLSCHEMA.
- option to backup MySQL configuration file, my.cnf
- remove files older then seven days from the BACKUPDIR directory.
- Added –master-data=2 and –single-transaction to include a replication information as a comment
- The ability to backup a single table in a database.
Tweet
Sean wrote:
I like your 404 and all, but a working download would be nice :)
Link | January 28th, 2011 at 6:11 pm
kedar wrote:
Mark, the link to automysqlbackup.sh is broken.
Link | January 29th, 2011 at 1:03 am
Raffael wrote:
Hi Mark,
I really like this software. I use it on several machines and I am mostly happy with it. On one machine I always get the following message:
mysqldump: Got error: 1044: Access denied for user ‘root’@'localhost’ to database ‘information_schema’ when using LOCK TABLES
I don’t know exactly why it is only on one machine. It could be because it is the newest MySQL version. Maybe you can write a fix for this in the next version.
And another idea: It would be cool to have a complementary restore script, where not only a database would be restored but the corresponding users and grants as well. (I guess this is not that easy. I didn’t find an easy solution either. But maybe you have a good idea.) Often it doesn’t make sense to restore the full mysql table just because one database gets restored.
Link | January 29th, 2011 at 8:19 am
mike wrote:
I think the link is bad :)
Link | January 29th, 2011 at 3:31 pm
mark wrote:
This link should be working. If you have trouble please email me mark @ grennan.com
I have not tested my updates on MySQL 5.5. I’m currently using 5.1.
Link | January 31st, 2011 at 10:51 am
Martin wrote:
Mark, the link for automysqlbackup.sh you’ve posted doesn’t work :-(
Link | February 8th, 2011 at 9:57 am
mark wrote:
This link is working for me. Can you tell me the link you are using?
http://www.mysqlfanboy.com/Files/automysqlbackup.sh
Link | February 8th, 2011 at 10:41 am
Martin wrote:
Hi,
The link in your article points to…
http://www.mysqlfanboy.com/2011/01/Files/automysqlbackup.sh
Thanks for the new link :-)
Link | February 8th, 2011 at 10:56 am
Eric H wrote:
Hi Mark,
I like the script a lot.
I would like to request a feature.
It would be nice to have mysqldump piped to gzip, so that it writes only compressed dumps to disk.
This will avoid excessive disk thrashing as it dumps then has to gzip after the dump is written to disk.
Thanks,
-Eric
Link | February 9th, 2011 at 11:23 am
Andy wrote:
I would really like to use this but I am getting the following error on a Ubuntu 8.0.4 LTS box:
line 466: {split($0,a,”.”) ; print a[1] }: command not found
Link | February 16th, 2011 at 10:57 am
Kelly grennan wrote:
Who was your great grandfather and your grandfather on the grennan side. All of our family is from ireland to squim washington then on from there. Fintan joesph grennan, fenton joesph grennan, george alden grennan, john “kelly” grennan ( me born in 1948 auburn washington, william lee grennan, dylan zane grennan Have never met another grennan that i wasnt related too. My great grandfather fintan joesph came from thomastown ireland. 12 children, his son my grandfather fenton joesph grennan born in squim washington one of 13, my father george alden grennan born in algonqin washington one of 13, myself oldest of nine born in auburn washington raised in enumclaw washington.
Link | March 5th, 2011 at 8:18 am
mark wrote:
I don’t know much of ancestry. I know my grandfather was Gilbert Grennan. My wife knows more than me. She is the genealogist in our family. You can write her at .
Link | March 7th, 2011 at 5:05 pm
Pascall wrote:
Hi,
I tried to use your script but i had the same error as Andy, and MORE!!
It remove everything in my /var/log et /var/www and some other folders!!!!
i gonna look at the script line after line to see if it’s a mistake or if you do it intentionally…
be careful if you use it !
Link | March 30th, 2011 at 12:43 am
mark wrote:
I reviewed the code. I didn’t see any way the script would delete the files you said unless you pointed your backups to be put in these directory?
Not smart if you did. The documentation says “… remove files older then seven …
days from the BACKUPDIR directory.”
Link | March 30th, 2011 at 1:37 pm