cyberpanel icon indicating copy to clipboard operation
cyberpanel copied to clipboard

[BUG] Retention not working on Backup

Open fresent opened this issue 2 years ago • 9 comments

Describe the bug

We have a local daily backup (full) scheduled for 3 days. The local backup system doesn't honor the retention policy, and keeps growing.

We ran into disk full and found, backups with over 60 days. We have cyberpanel installations with version 2.0 to 2.2 and issue is happening on all of them.

fresent avatar Jul 28 '22 13:07 fresent

Maybe first try update latest 2.3 version before send bug report.. Your versions are many months old.

Dreamer41 avatar Jul 29 '22 03:07 Dreamer41

That's a fair point.

We did went through changelog list to see, if a fix related to this was introduced there before logging a bug report. However, with projects like this, its common that not everything might go in change log.

After your reply, we re-checked our installations and found it's indeed replicating on one of our test node as well with below version,

Current Version : 2.3 Build : 1Current Commit : d3256678becae4aa4ecebb5f3efe6cf087df3904 Latest Version : 2.3 Latest Build : 2Latest Commit : d617e48d37b9f7bb65ffa6a23547bd8a9a99853e

Just upgraded one of our test node to latest commit, will wait for current daily cycle of 3 days and report if the issue still persist.

fresent avatar Jul 29 '22 06:07 fresent

I also published a post on the forum about this issue for months now without answer, I don't know why. I noticed that there is another topic, maybe more. Hope they fix it as soon as possible.

hadi060 avatar Aug 04 '22 11:08 hadi060

Can confirm now, the issue still persist in current version.

Backup retention days are not honored and backups keep accumulating till disk get full.

fresent avatar Aug 04 '22 20:08 fresent

Still not working.

snawaze avatar Aug 27 '22 13:08 snawaze

It's highly recommend update all your servers with cyberpanel to latest 2.3. There was some serious security issues too on previous version what 2.3 patched.

On Fri, Jul 29, 2022, 13:18 Fresent @.***> wrote:

That's a fair point.

We did went through changelog list to see, if a fix related to this was introduced there before logging a bug report. However, with projects like this, its common that not everything might go in change log.

After your reply, went back to re-check version and found it's indeed replicating on one of our test node as well with below version,

Current Version : 2.3 Build : 1Current Commit : d325667 https://github.com/usmannasir/cyberpanel/commit/d3256678becae4aa4ecebb5f3efe6cf087df3904 Latest Version : 2.3 Latest Build : 2Latest Commit : d617e48 https://github.com/usmannasir/cyberpanel/commit/d617e48d37b9f7bb65ffa6a23547bd8a9a99853e

Just upgraded one of our test node to current latest commit, will wait for current daily cycle of 3 days and report if anything issue still persist.

— Reply to this email directly, view it on GitHub https://github.com/usmannasir/cyberpanel/issues/938#issuecomment-1198920332, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZOH5EPHF22KGRJ5P72M673VWNZSFANCNFSM545LHFXQ . You are receiving this because you commented.Message ID: @.***>

Dreamer41 avatar Oct 11 '22 09:10 Dreamer41

@fresent I can confirm that this bug is still present.

Current Version:  2.3
Build:  2
Current Commit:  bb6d095a5362deccf8166759ce69d8576eafc7c7

I will perform CyberPanel to 2.3 - commit 53ca589b8a6c6db32b7c19730ced15c7f2647215 and report in couple of days. Looking at changelog and pull requests I can't find any, even remotely related commits being merged though.

broiniac avatar Jan 10 '23 17:01 broiniac

As expected based on commit history - retention is not working.

There are 5 columns in /backup/scheduleBackup Last Run | All Sites | Frequency (<Period>) | Retention (<Period>) | Current Status Retention column value is Not running. Changing anything in Frequency column (there is a select box) displays red, error flash message with Operation Failed! 'backupRetention' text.

Any alternative using CyberPanel with working backup retention at this time, or I should rather go for custom shell scripts?

broiniac avatar Jan 17 '23 06:01 broiniac

For anyone waiting for this one to be fixed - simplest workaround would be to use cron job. For example:

0 3 * * * find /home/backup/ -type d -mtime +5 -exec rm -r {} \; >/dev/null 2>&1

Will run: 0 3 * * * - daily at 3:00 am find /home/backup - search /home/backup directory recursively -type d - for directories only -mtime +5 - older then 5 days -exec - and run on them… rm -r {} - … command rm -r <directory> \; - separately for each directory >/dev/null 2>&1 - discard any potential output

broiniac avatar Jun 26 '23 08:06 broiniac