Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Avoid calling clearTempFiles() by default while export() #33

Closed
albilu opened this issue Sep 30, 2023 · 2 comments
Closed

Comments

@albilu
Copy link

albilu commented Sep 30, 2023

Use Case:
We need to be able to grab the exported files(specifically the zip) use them in some process (example send them to an SFTP server) and then call clearTempFiles() to delete the files.

Right now this is not possible as clearTempFiles() is call by default while exporting and if i set PRESERVE_GENERATED_ZIP i can use the zip file as i want but then when i called clearTempFiles() the files are not cleaned.

This will give more flexibility. So please take into account.

@SeunMatt
Copy link
Owner

SeunMatt commented Oct 1, 2023

This is already possible. Set the property MysqlExportService.PRESERVE_GENERATED_ZIP to true.

//...
properties.setProperty(MysqlExportService.PRESERVE_GENERATED_ZIP, "true");
MysqlExportService mysqlExportService = new MysqlExportService(properties);
mysqlExportService.export();
File file = mysqlExportService.getGeneratedZipFile();

You can read more about it here https://smattme.com/posts/how-to-backup-mysql-database-programmatically-using-mysql-backup4j/

@SeunMatt SeunMatt closed this as completed Oct 1, 2023
@albilu
Copy link
Author

albilu commented Oct 1, 2023

This is already possible. Set the property MysqlExportService.PRESERVE_GENERATED_ZIP to true.

//...
properties.setProperty(MysqlExportService.PRESERVE_GENERATED_ZIP, "true");
MysqlExportService mysqlExportService = new MysqlExportService(properties);
mysqlExportService.export();
File file = mysqlExportService.getGeneratedZipFile();

You can read more about it here https://smattme.com/posts/how-to-backup-mysql-database-programmatically-using-mysql-backup4j/

This is not available anymore in version 1.2.1 wich is the latest.

You can verify from the master branch also the method doesnt take any parameter: https://github.com/SeunMatt/mysql-backup4j/blob/master/src/main/java/com/smattme/MysqlExportService.java#L469

From the link you provided the boolean parameter was indeed supported for 1.0.1

Was there any reason to remove it? Otherwise it is a regression and you might want to add it back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants