How to transfer mysql backup files across network or emails?

Say for example, you generate a mysql dump called “mysql.dump” from your database the size of which is beyond the file transferable limit of your email account. The following steps will help you in making the file transfer possible

List the files to ensure that there exists the dump file in /tmp directory.

root@mymachine:/tmp# ls -l
-rw-r–r– 1 root root 299980 2009-04-06 13:56 mysql.dump

Zip the files – to reduce file size

root@mymachine:/tmp# zip mysql.dump.zip mysql.dump

Check the file size of the zipped file to see if it is within transferable limit. If it is not, then split the zipped files by issuing

root@mymachine:/tmp# split –bytes=50K mysql.dump.zip unit_

This creates a small units of 50K size files in the names unit_aa, unit_ab etc.

Now this should help you in making the file transfer possible as small units.

The receiver of these files should follow the below steps to regroup the files
i) Combine smaller units to one zip file
ii) Unzip the file to get the actual content

root@mymachine:/tmp# cat unit_a? > mysql.dump.out.zip
The above command combines all the units to a single output zipped version

Then, issue the unzip command as follows
root@mymachine:/tmp# unzip mysql.dump.out.zip

And you will get the mysql dump as a single unit.