1
0
Fork 1

Add a timestamp to the settings backup too

This commit is contained in:
Torsten Flammiger 2023-06-26 21:07:05 +02:00
parent 9b0cb1a41d
commit baaa910c65

View file

@ -486,7 +486,7 @@ public class ExportBackupService extends Service {
boolean success = false;
ObjectOutputStream output = null;
try {
final File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Database" + File.separator, "settings.dat");
final File file = new File(getBackupDirectory(null), "settings_" + ((new SimpleDateFormat("yyyy-MM-dd_HH-mm-ss")).format(new Date()) + ".dat"));
final File directory = file.getParentFile();
if (directory != null && directory.mkdirs()) {
Log.d(Config.LOGTAG, "created backup directory " + directory.getAbsolutePath());