Failed mysqldump: Does Restic Create a Snapshot?

Hello Restic Community,

I’m using Restic (0.13.1) to back up data that is piped from mysqldump. Sometimes, mysqldump encounters errors that cause the backup process to fail. For example:

mysqldump: Error 1412: Table definition has changed, please retry transaction when dumping table ‘scopes_customergroup_data_exporter_sync_batches’ at row: 0

mysqldump: Couldn’t execute ‘show create table ‘tmp_pimgento_entities_family’’: Table ‘magento2db.tmp_pimgento_entities_family’ doesn’t exist (1146)

When these errors occur, does Restic still create a new snapshot in the storage? This information is critical as I apply a retention policy (restic forget) after every successful backup, and I need to decide whether to apply the policy even when backups fail due to errors in mysqldump.

Any insights or recommendations would be greatly appreciated.

Thank you!

So why you use method you are not sure how it works when you can make it fool proof by simply running mysql dump to some temp folder and restic in sequence when restic run depends on result of previous operation?

Plus I think you know you are using very old restic version - maybe at the end your backups are not critical at all:)

1 Like

This topic was also discussed in Failed database dump results in valid snapshot. As a result, --stdin-from-command option in backup command (Documentation) has been implemented in restic 0.17.0.

4 Likes