auto_backup icon indicating copy to clipboard operation
auto_backup copied to clipboard

Conflict between db names

Open Linekio opened this issue 6 years ago • 2 comments

The condition "if rec.name in fullpath:" (line 279 of auto_backup.py branch 12.0) may cause deletion of wrong files if:

  • I have two databases "foo" and "foobar" ("foo" in "foobar" is True)
  • I save the backups in the same folder for both
  • Autoremove config is different

Maybe consider a regex...

Linekio avatar Feb 14 '19 10:02 Linekio

Hmm, indeed. Good catch, I never thought about that case. On the wishlist/todo list.

Yenthe666 avatar Feb 14 '19 10:02 Yenthe666

Another thing: I think it's better to get the date from the file name, rather than with os.stat. Because recently I moved all backups to another folder, which changed st_ctime. This is all the more serious since I added a condition to always keep one backup per month:

if createtime.day != 1:
    _logger.info("Delete local out-of-date file: %s", fullpath)
    os.remove(fullpath)

But since st_ctime changed, I lost those backups.

Linekio avatar May 17 '19 13:05 Linekio