SUMMARY *** I created a dedicated plan with an "Interval" schedule, set to 1 day. The backup disk is an SSD in the PC itself. It is auto-mounted at boot. Backup seems to work fine after a fresh boot, but I often put the PC to sleep (suspend to RAM?) and noticed that Kup does not seem to do a backup after the system wakes up. Today, I saw the message in the tray telling me that Kup had last backed up 11 days ago. The log only shows the last successful backup - no error messages there. I can trigger a backup by either clicking on "save new backup", or un-mounting and re-mounting the destination disk. *** STEPS TO REPRODUCE 1. Set up a daily scheduled backup plan 2. Wait for first backup to finish 3. Suspend the PC 4. See if the next backup is executed OBSERVED RESULT On my PC, no further automatic backups until a reboot. EXPECTED RESULT Automatic backup to (still mounted) destination disk 24h after previous backup. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Manjaro KDE, Kernel 5.15.91-1 (available in About System) KDE Plasma Version: 5.26.5 KDE Frameworks Version: 5.102.0 Qt Version: 5.15.8 ADDITIONAL INFORMATION Kup 0.9.1-5 from Manjaro Official Repositories
Thanks for the report! Very clear. I will need to look into how the process sleep is handled across suspension, I think I had tested that and it worked back long ago when I worked on that part of kup.
Thank you for your kind reply. Just for the record, I cannot with certainty say that the issue is linked to putting the device in sleep mode. I never keep it running > 24h, so I don't know if the backup would be triggered correctly w/o the interim sleep condition. I am not a Linux expert, but if there is any test I can run or log I can retrieve to help you, please let me know.
So, I am a bit confused. I tried reproducing the issue more conveniently by setting the backup interval to 5 minutes. Observations: 1) If the system is suspended and then immediately woken up again before the 5 minutes are over, it resumes the backups as scheduled. 2) If the system misses a backup while asleep, it will not perform a backup after waking up to compensate. But it will resume when the next 5-minute-interval is reached. So I think what is missing is that I would expect a backup to be performed after system resume, if the previous backup has been missed.
OK, excellent. Then it actually behaves as designed then. I agree that saving a new backup as soon as possible after a missed schedule would be good to have, and users would be right to expect it. For anyone who has time and interest to help fix this problem: The current scheduler goes to sleep with a duration which is the remaining time until next "backup save time". The solution here could be to instead just sleep 5 minutes and then upon wake up, check if it's time to save a new backup. If not, go back to sleep for another five minutes.
Apologies, I still believe I fully haven't understood what is actually going on. I put the interval back on 1 day, and unlike when I had the 5-min-setting, it did not execute the backup when the 24 h were exceeded despite the PC being powered on at the time (although it had been suspended in the interim). So something still isn't quite right I guess? That said, kup realizes that something is amiss - the icon turned yellow when the 24 h were exceeded.
Git commit e09c9b1e9fcdc34d157c383694dee5e00cf091e3 by Simon Persson. Committed on 22/02/2023 at 21:25. Pushed by persson into branch 'master'. Change sleep duration for interval plan executor The problem was that time spent with computer in suspend mode was not advancing the process timer. So backup saving every 24 h would happen 27 hours after last save if three hours was spent suspended. Fix by checking if it's time to save every five minutes. M +4 -2 daemon/planexecutor.cpp https://invent.kde.org/system/kup/commit/e09c9b1e9fcdc34d157c383694dee5e00cf091e3