mysqldump-command doesn't really support viewing the progress of exporting a database. I guess it's because it gives overhead, and it's frankly quite difficult to generate a fluid progressbar.
Therefore I've created a simple script to show an estimation of the process of a
mysqldump. It does so by calculating the size of all the tables in the given database and comparing this with the size of the resulting sql file.
Simply save the snippet above as
mysqldump-progress.sh or something similar. The usage is quite simple:
Allthough this method isn't precise at all, it gives a good indication of the progress. Handy dandy when exporting bigger databases.
sudo to ensure access to defaults file.
- Changed options to mysqldump to ensure large databases can be properly exported, also include events and routines.
- Remove the need for
pv show more details.