Hey @JTok, just started using this plugin. Awesome work. I was going to check whether I should start writing small script for myself, using snapshots for my VMs, but then I found your plugin.
Good stuff really. Found out, that "Number of days to keep backups" must be 0, or higher/equal 7. 1-6 are not working, its not in the specified format.
Went through the code, figured out in line 1419
elif [ "$number_of_days_to_keep_backups" -ge 7 ] && [ "$number_of_days_to_keep_backups" -le 180 ]; then
Why have you configured 7 as the minimum? I mean, makes sense for backups really, but image someone linke my who wants to test it first, see if stuff gets deleted after one day, and then let it run automatically.
Something you may want to consider to change?
Also I think you miss an exception for deleting potential error logs. Means, you have proper exception for the script not to faul, but the logfil suggest this as an error, wheras I think its fine (or at this point you actually awaiting to find a file?).
find: '/mnt/default_ssd_cache/Backup/Zeus/VMs/logs/*unraid-vmbackup_error.log': No such file or directory
2021-07-02 22:31:19 information: did not find any error log files to remove.
Line 2785
deleted_files=$(find "$backup_location/$log_file_subfolder"*unraid-vmbackup.log -type f -printf '%T@\t%p\n' | sort -t $'\t' -gr | tail -n +$log_files_plus_1 | cut -d $'\t' -f 2- | xargs -d '\n' -r rm -fv --)
Then, unfortunately, after taking the backup, the copy of the file failed, based on the scripts output:
2021-07-02 22:46:33 failure: copy of /mnt/user/VMs/Athene-Server/vdisk1.img to /mnt/default_ssd_cache/Backup/Zeus/VMs/Athene-Server/20210702_2243_vdisk1.img.zst failed.
But I can confirm, the files have been created:
root@Zeus-Server:/mnt/default_ssd_cache/Backup/Zeus/VMs/Athene-Server# ls -lisa
total 30203084
523493 0 drwxrwxrwx 1 root root 308 Jul 2 22:46 ./
522862 0 drwxrwxrwx 1 root root 60 Jul 2 22:43 ../
525076 128 -rw-rw-rw- 1 root users 131072 Jul 2 22:46 20210702_2243_76070b23-2217-0c51-808e-9be6c25b8f0e_VARS-pure-efi.fd
525075 8 -rw-rw-rw- 1 root root 7194 Jul 2 22:46 20210702_2243_Athene-Server.xml
525009 4225000 -rwxrwxrwx 1 root users 4326397656 Jul 2 22:46 20210702_2243_vdisk1.img.zst*
525038 25977948 -rwxrwxrwx 1 root users 26601417527 Jul 2 22:46 20210702_2243_vdisk2.img.zst*
Looking int othe script, lines 203-228 of default-script, youre doing the copy and rely on the error code of rsync and/or copy. As there is no possibility to debug this, I can't really see where the issue is. Can you suggest how I can help on this? Cleaned already the folders up, just to ensure it's really not a permission issue, or an old snap.
BTW, are you running incremental snapshots, or everytime full snaps?
And, for those who want/need to use snaps, I think the deletion is a problem in general. See I now have choosen my SSD cache for backups, assuming mover will move them later. You mentioned that "PATH" must not be /mnt/user* so you can only choose the cache or a specifc disk. The latter can cause problems if the disk is full etc.
So question here is, what happens to those files that will be moved by Mover, as the path is no longer "/mnt/mycache". What is preventing you from using "user" or "user0" in the first place?
Unsure if this format of feedback suits you, otherwise I can create pull requests on git
Best,
IceBoosteR