Creating a Windows database backup service
It seems you are trying to roll you own incremental backup script. The short answer is: 

Don't.



There are so many things to consider when doing backups and even more for incremental backups that it's very difficult to be done right. 
Using a simple INSERT IGNORE (which ignores many errors, not only duplicate key errors) is not going to work and give you incremental backups.  

Also note that a database has a few more things besides tables. There are view definitions and events that you may want to backup as well. And that tables are created and deleted and changed (columns added, dropped, modified, triggers added or dropped, etc).

Plus a backup has to be a consistent snapshot of the database, so whatever a script does has to be either a single transaction or while the database is not modified by any other session.

I suggest you start by reading the MySQL documentation on:

Backup and Recovery

It explains the various backup types and methods that can be used. There is no solution that covers all situations so the answer for your specific case depends on what exactly is your objective (normal backups, incremental backups) and many other details like the version, edition, the tables' engine (MyISAM, InnoDB, NBD, etc.), whether the database will be accessed during the backups or not, etc. 

You might find that a simple mysqldump of the 5 databases is all you need.