jensstein / oandbackup

backup manager for android
Other
539 stars 192 forks source link

[Enhancement] Temporary directory for backup #286

Open myroad94 opened 3 years ago

myroad94 commented 3 years ago

Hi,

I use oandbackup extensively with scheduling frequent backup. As soon as the backup are done, I upload these with Nextcloud automatically in Android. The thing is the backup first start with uncompressed files (for data), so I have lots of random name file because it is detected by Nextcloud while oandbackup is still constructing the archive. This generated tons of failed upload in Nextcloud client because they are deleted quickly after the archive is done. The solution is quite simple in theory: it would require to set in oandbackup a different temporary directory to do all these work and do an atomic move of the archive at the end :) The temporary directory can be a parameter, or it could be /tmp as long as the directory is purged each time the archive is done to avoid space issue.

Is-that possible? Thank you!

myroad94 commented 3 years ago

If the author does not have time, maybe I can do a pull request with a simple implementation (/tmp). I guess it is a simple matter of changing this line https://github.com/jensstein/oandbackup/blob/master/src/main/java/dk/jens/backup/tasks/BackupTask.java#L36 to an arbitrary temporary directory, and adding a Files.move after that?