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
omv-backup - option "keep the last x days" not working #19
Comments
Are you using version 4.0.5? I fixed this a few weeks ago - 468c469 |
Yes. 4.0.5. I see no other versions in the plugin section |
Unfortunately, the plugin tab saying 4.0.5 doesn't necessarily mean you are using 4.0.5 since only one version shows up in that list. It could mean it is available. What is the output of: dpkg -l | grep openm |
Also 4.0.5 |
I think some files from old days were deleted and some not. Unfortunately I deleted the old files today so I can not say, which files were deleted by plugin and which files not. But I can say, that the DD image files was not deleted. |
The plugin is a using a find command with the mtime and delete flags. I don't know how this would be wrong unless something on your system is changing the modified time. I would like to see an ls -al of the directory when there is more than the set number of days. You could also change to the directory and do a find . -maxdepth 1 -type f -mtime +3 -name "backup-omv*" to see what it would delete. When I run this command on my system, January 17th backups are still there. If I change it to 2 days, only the January 17th backups are deleted. So, everything is working as expected when using find. |
This is the output of ls -la: -rw-rw-rw-+ 1 root users 726 Jan 19 00:00 backup-omv-19-Jan-2019_00-00-01.blkid |
If I do a "find" with +1 (older files I'd deleted manually) then the 19th january files are shown, but I don't know, why it not work automatically. Is there a log I can check? |
+1 means 24 hours. Your backup on the 19th is the only one more than 24 hours old. So, I think it is working but you are thinking days where it is translated into hours and the oldest backup is technically within that time frame. If it keeps the dd file and not the other files, it is because the last modified time for the dd image is 41 minutes after the other files. since this is a scheduled backup at midnight, the find command is run at 12:41 (after the backup). The non-dd files are outside of your 72 hour window where the dd file is still within it by 41 minutes. If you want less backups, I would lower the number of days because I don't want to use something other than find in the plugin. |
I looked in the "backup" script to try to reproduce the run... where to find 'keep=$(omv_config_get "/config/system/backup/keep")' On my OMV I have no "config" folder in system root... Maybe this is the problem to omv-backup not find the 'keep' variable? |
I guess I could "touch" all of the backup files for that run so they have the same timestamp. What is the output of the following as root: omv-showkey backup |
That isn't a folder. It is xml structure in /etc/openmediavault/config.xml. And trust me, if it wasn't finding your days, that would translate to zero and then it would never purge any backups. |
My oldest backup today morning was the 17th (the fifth day and the first update I've done). In sum this was 5 backups. I try now with setting "1" an will look, how many backups will deleted in a couple of days. |
|
I believe we have a misunderstanding... My problem isn't, that backups are deleted, rather then they are not deleted after the period of days. I'll only keep 3 backups. Today morning I had 5 backkups, so 2 too much ;-) |
No, it isn't five days. I understand what you are telling me but I don't think are understanding how find works. Look at this: Even if I changed the all the files modified times to the same time, you will still have four backups since the current backup is 0 days and the backup from 3 days ago isn't 4 days yet. So, find won't delete it. |
Your config looks right. |
Good morning, I checked the folder with setting "1" and now I have 2 backups, so it really works. Yesterday I was a little confused, that more backupd (days) exists, than I have setup. With Setting "1" I have backups of 2 days so I now choose "2" for 3 backups... Thanks for your help and explanations yesterday. |
Hi,
I use openmediavault-backup from omv-extras.org to backup my OMV system partition (DD method). I've setup to hold backups from the last 3 days. This seems not to work. I see backups of 5 days 17 - 21 january). Backups of 2 days weren't deleted.
The text was updated successfully, but these errors were encountered: