Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Backups fill up partition #220

Closed
H34dl3ss opened this issue Jul 4, 2021 · 49 comments · Fixed by #296
Closed

Backups fill up partition #220

H34dl3ss opened this issue Jul 4, 2021 · 49 comments · Fixed by #296
Assignees
Labels
bug Something isn't working

Comments

@H34dl3ss
Copy link

H34dl3ss commented Jul 4, 2021

Hi,
today I found my RPi that runs the gravity-sync with heavy disk activity.
I checked processes to find the sqlite backup task on top running for 48+ hours or so.
Vent checking free space on the partition and found it 100% filled up.
About 6GB of the 16GB partition were backups of gravity-sync.
I'm not sure, how much space I should provision for the backup folder but I think 6GB are a little bit too much.

It looks like this issue started after I updated to the most recent version of gravity-sync at the beginning of june.
As far as I understand, the backups rotate at 3 days by default.
Is it correct that every sync which is at 30 minutes is supposed to fire a backup?
That's a lot of traffic and a lot of space...

I deleted the backups and after a couple of minutes the sqlite process finished.

See the content of my backup directory:
(sorry for quoting, but the code tags have no line feed)

insgesamt 5736680
635707392 Jun 11 04:00 2021-06-11-040001-gravity.db.backup
0 Jun 12 04:00 2021-06-12-040001-custom.list.backup
635707392 Jun 12 04:00 2021-06-12-040001-gravity.db.backup
635707392 Jun 12 21:30 2021-06-12-213007-gravity.db.backup
635707392 Jun 12 22:00 2021-06-12-220007-gravity.db.backup
636829696 Jun 13 03:31 2021-06-13-033007-gravity.db.backup
0 Jun 13 04:00 2021-06-13-040001-custom.list.backup
636829696 Jun 13 04:00 2021-06-13-040001-gravity.db.backup
85872640 Jun 13 04:30 2021-06-13-043008-gravity.db.backup
1024 Jun 13 04:30 2021-06-13-043008-gravity.db.backup-journal
0 Jun 13 05:00 2021-06-13-050007-gravity.db.backup
0 Jun 13 05:30 2021-06-13-053007-gravity.db.backup
0 Jun 13 06:00 2021-06-13-060008-gravity.db.backup
0 Jun 13 06:30 2021-06-13-063008-gravity.db.backup
0 Jun 13 07:00 2021-06-13-070007-gravity.db.backup
0 Jun 13 07:30 2021-06-13-073008-gravity.db.backup
0 Jun 13 08:00 2021-06-13-080007-gravity.db.backup
0 Jun 13 08:30 2021-06-13-083007-gravity.db.backup
0 Jun 13 09:00 2021-06-13-090007-gravity.db.backup
0 Jun 13 09:30 2021-06-13-093008-gravity.db.backup
0 Jun 13 10:00 2021-06-13-100007-gravity.db.backup
0 Jun 13 10:30 2021-06-13-103007-gravity.db.backup
0 Jun 13 11:00 2021-06-13-110008-gravity.db.backup
0 Jun 13 11:30 2021-06-13-113007-gravity.db.backup
0 Jun 13 12:00 2021-06-13-120007-gravity.db.backup
0 Jun 13 12:30 2021-06-13-123008-gravity.db.backup
0 Jun 13 13:00 2021-06-13-130007-gravity.db.backup
0 Jun 13 13:30 2021-06-13-133007-gravity.db.backup
0 Jun 13 14:00 2021-06-13-140008-gravity.db.backup
0 Jun 13 14:30 2021-06-13-143007-gravity.db.backup
0 Jun 13 15:00 2021-06-13-150007-gravity.db.backup
0 Jun 13 15:30 2021-06-13-153008-gravity.db.backup
0 Jun 13 16:00 2021-06-13-160007-gravity.db.backup
0 Jun 13 16:30 2021-06-13-163007-gravity.db.backup
0 Jun 13 17:00 2021-06-13-170007-gravity.db.backup
0 Jun 13 17:30 2021-06-13-173008-gravity.db.backup
0 Jun 13 18:00 2021-06-13-180007-gravity.db.backup
0 Jun 13 18:30 2021-06-13-183007-gravity.db.backup
0 Jun 13 19:00 2021-06-13-190008-gravity.db.backup
0 Jun 13 19:30 2021-06-13-193007-gravity.db.backup
0 Jun 13 20:00 2021-06-13-200007-gravity.db.backup
0 Jun 13 20:30 2021-06-13-203007-gravity.db.backup
0 Jun 13 21:00 2021-06-13-210008-gravity.db.backup
0 Jun 13 21:30 2021-06-13-213007-gravity.db.backup
0 Jun 13 22:00 2021-06-13-220007-gravity.db.backup
0 Jun 13 22:30 2021-06-13-223007-gravity.db.backup
0 Jun 13 23:00 2021-06-13-230007-gravity.db.backup
0 Jun 13 23:30 2021-06-13-233007-gravity.db.backup
0 Jun 14 00:00 2021-06-14-000007-gravity.db.backup
0 Jun 14 00:30 2021-06-14-003008-gravity.db.backup
0 Jun 14 01:00 2021-06-14-010007-gravity.db.backup
0 Jun 14 01:30 2021-06-14-013007-gravity.db.backup
0 Jun 14 02:00 2021-06-14-020007-gravity.db.backup
0 Jun 14 02:30 2021-06-14-023008-gravity.db.backup
0 Jun 14 03:00 2021-06-14-030008-gravity.db.backup
0 Jun 14 03:30 2021-06-14-033008-gravity.db.backup
0 Jun 14 04:00 2021-06-14-040001-gravity.db.backup
0 Jun 14 04:00 2021-06-14-040007-gravity.db.backup
0 Jun 14 04:30 2021-06-14-043007-gravity.db.backup
0 Jun 14 05:00 2021-06-14-050007-gravity.db.backup
0 Jun 14 05:30 2021-06-14-053007-gravity.db.backup
0 Jun 14 06:00 2021-06-14-060007-gravity.db.backup
0 Jun 14 06:30 2021-06-14-063008-gravity.db.backup
0 Jun 14 07:00 2021-06-14-070008-gravity.db.backup
0 Jun 14 07:30 2021-06-14-073008-gravity.db.backup
0 Jun 14 08:00 2021-06-14-080007-gravity.db.backup
0 Jun 14 08:30 2021-06-14-083007-gravity.db.backup
0 Jun 14 09:00 2021-06-14-090007-gravity.db.backup
0 Jun 14 09:30 2021-06-14-093007-gravity.db.backup
0 Jun 14 10:00 2021-06-14-100007-gravity.db.backup
0 Jun 14 10:30 2021-06-14-103008-gravity.db.backup
0 Jun 14 11:00 2021-06-14-110007-gravity.db.backup
0 Jun 14 11:30 2021-06-14-113008-gravity.db.backup
0 Jun 14 12:00 2021-06-14-120007-gravity.db.backup
0 Jun 14 12:30 2021-06-14-123007-gravity.db.backup
0 Jun 14 13:00 2021-06-14-130007-gravity.db.backup
0 Jun 14 13:30 2021-06-14-133007-gravity.db.backup
0 Jun 14 14:00 2021-06-14-140007-gravity.db.backup
0 Jun 14 14:30 2021-06-14-143007-gravity.db.backup
0 Jun 14 15:00 2021-06-14-150007-gravity.db.backup
0 Jun 14 15:30 2021-06-14-153007-gravity.db.backup
7036928 Jun 20 00:00 2021-06-20-000007-gravity.db.backup
1024 Jun 20 00:00 2021-06-20-000007-gravity.db.backup-journal
0 Jun 20 00:30 2021-06-20-003008-gravity.db.backup
0 Jun 20 01:00 2021-06-20-010007-gravity.db.backup
0 Jun 20 01:30 2021-06-20-013008-gravity.db.backup
0 Jun 20 02:00 2021-06-20-020007-gravity.db.backup
0 Jun 20 02:30 2021-06-20-023007-gravity.db.backup
0 Jun 20 03:00 2021-06-20-030007-gravity.db.backup
0 Jun 20 03:31 2021-06-20-033007-gravity.db.backup
0 Jun 20 04:00 2021-06-20-040001-gravity.db.backup
0 Jun 20 04:30 2021-06-20-043007-gravity.db.backup
0 Jun 20 05:00 2021-06-20-050008-gravity.db.backup
0 Jun 20 05:30 2021-06-20-053008-gravity.db.backup
0 Jun 20 06:00 2021-06-20-060007-gravity.db.backup
0 Jun 20 06:30 2021-06-20-063008-gravity.db.backup
0 Jun 20 07:00 2021-06-20-070008-gravity.db.backup
0 Jun 20 07:30 2021-06-20-073007-gravity.db.backup
0 Jun 20 08:00 2021-06-20-080007-gravity.db.backup
0 Jun 20 08:30 2021-06-20-083008-gravity.db.backup
0 Jun 20 09:00 2021-06-20-090007-gravity.db.backup
0 Jun 20 09:30 2021-06-20-093008-gravity.db.backup
99340288 Jun 20 10:01 2021-06-20-100005-gravity.db.backup
99340288 Jun 20 10:31 2021-06-20-103005-gravity.db.backup
99340288 Jun 20 11:01 2021-06-20-110005-gravity.db.backup
99340288 Jun 20 11:31 2021-06-20-113005-gravity.db.backup
99340288 Jun 20 12:01 2021-06-20-120006-gravity.db.backup
23449600 Jun 20 12:31 2021-06-20-123008-gravity.db.backup
1024 Jun 20 12:31 2021-06-20-123008-gravity.db.backup-journal
0 Jun 20 13:01 2021-06-20-130005-gravity.db.backup
0 Jun 20 13:31 2021-06-20-133005-gravity.db.backup
0 Jun 20 14:01 2021-06-20-140005-gravity.db.backup
0 Jun 20 14:31 2021-06-20-143005-gravity.db.backup
0 Jun 20 15:01 2021-06-20-150005-gravity.db.backup
0 Jun 20 15:31 2021-06-20-153005-gravity.db.backup
0 Jun 20 16:01 2021-06-20-160005-gravity.db.backup
0 Jun 20 16:31 2021-06-20-163006-gravity.db.backup
0 Jun 20 17:01 2021-06-20-170005-gravity.db.backup
0 Jun 20 17:31 2021-06-20-173005-gravity.db.backup
0 Jun 20 18:01 2021-06-20-180006-gravity.db.backup
0 Jun 20 18:31 2021-06-20-183005-gravity.db.backup
0 Jun 20 19:01 2021-06-20-190005-gravity.db.backup
0 Jun 20 19:31 2021-06-20-193006-gravity.db.backup
0 Jun 20 20:01 2021-06-20-200006-gravity.db.backup
0 Jun 20 20:31 2021-06-20-203005-gravity.db.backup
0 Jun 20 21:01 2021-06-20-210005-gravity.db.backup
0 Jun 20 21:31 2021-06-20-213005-gravity.db.backup
0 Jun 20 22:01 2021-06-20-220005-gravity.db.backup
0 Jun 20 22:31 2021-06-20-223005-gravity.db.backup
0 Jun 20 23:01 2021-06-20-230005-gravity.db.backup
0 Jun 20 23:31 2021-06-20-233006-gravity.db.backup
0 Jun 21 00:01 2021-06-21-000005-gravity.db.backup
0 Jun 21 00:31 2021-06-21-003005-gravity.db.backup
0 Jun 21 01:01 2021-06-21-010005-gravity.db.backup
0 Jun 21 01:31 2021-06-21-013005-gravity.db.backup
0 Jun 21 02:01 2021-06-21-020005-gravity.db.backup
0 Jun 21 02:31 2021-06-21-023005-gravity.db.backup
0 Jun 21 03:01 2021-06-21-030005-gravity.db.backup
0 Jun 21 03:31 2021-06-21-033005-gravity.db.backup
0 Jun 21 04:00 2021-06-21-040001-gravity.db.backup
0 Jun 21 04:01 2021-06-21-040005-gravity.db.backup
0 Jun 21 04:31 2021-06-21-043005-gravity.db.backup
0 Jun 21 05:01 2021-06-21-050005-gravity.db.backup
0 Jun 21 05:31 2021-06-21-053005-gravity.db.backup
0 Jun 21 06:01 2021-06-21-060006-gravity.db.backup
0 Jun 21 06:31 2021-06-21-063006-gravity.db.backup
0 Jun 21 07:01 2021-06-21-070005-gravity.db.backup
0 Jun 21 07:31 2021-06-21-073005-gravity.db.backup
0 Jun 21 08:01 2021-06-21-080006-gravity.db.backup
0 Jun 21 08:31 2021-06-21-083005-gravity.db.backup
0 Jun 21 09:01 2021-06-21-090006-gravity.db.backup
0 Jun 21 09:31 2021-06-21-093005-gravity.db.backup
0 Jun 21 10:01 2021-06-21-100005-gravity.db.backup
0 Jun 21 10:31 2021-06-21-103006-gravity.db.backup
0 Jun 21 11:01 2021-06-21-110005-gravity.db.backup
0 Jun 21 11:31 2021-06-21-113005-gravity.db.backup
0 Jun 21 12:01 2021-06-21-120005-gravity.db.backup
0 Jun 21 12:31 2021-06-21-123005-gravity.db.backup
0 Jun 21 13:01 2021-06-21-130005-gravity.db.backup
0 Jun 21 13:31 2021-06-21-133005-gravity.db.backup
0 Jun 21 14:01 2021-06-21-140005-gravity.db.backup
0 Jun 21 14:31 2021-06-21-143006-gravity.db.backup
0 Jun 21 15:01 2021-06-21-150005-gravity.db.backup
0 Jun 21 16:01 2021-06-21-160005-gravity.db.backup
0 Jun 21 17:01 2021-06-21-170006-gravity.db.backup
0 Jun 21 18:01 2021-06-21-180005-gravity.db.backup
0 Jun 21 18:31 2021-06-21-183006-gravity.db.backup
0 Jun 21 19:31 2021-06-21-193005-gravity.db.backup
0 Jun 21 21:01 2021-06-21-210006-gravity.db.backup
0 Jun 21 21:31 2021-06-21-213005-gravity.db.backup
0 Jun 21 23:30 2021-06-21-233006-gravity.db.backup
0 Jun 22 00:00 2021-06-22-000005-gravity.db.backup
0 Jun 22 01:00 2021-06-22-010005-gravity.db.backup
0 Jun 22 03:00 2021-06-22-030006-gravity.db.backup
0 Jun 22 03:30 2021-06-22-033005-gravity.db.backup
14647296 Jun 27 00:00 2021-06-27-000006-gravity.db.backup
1024 Jun 27 00:00 2021-06-27-000006-gravity.db.backup-journal
0 Jun 27 00:30 2021-06-27-003005-gravity.db.backup
0 Jun 27 02:00 2021-06-27-020005-gravity.db.backup
0 Jun 27 02:30 2021-06-27-023005-gravity.db.backup
0 Jun 27 03:00 2021-06-27-030006-gravity.db.backup
0 Jun 27 03:31 2021-06-27-033005-gravity.db.backup
0 Jun 27 04:00 2021-06-27-040001-gravity.db.backup
0 Jun 27 05:30 2021-06-27-053005-gravity.db.backup
0 Jun 27 07:00 2021-06-27-070005-gravity.db.backup
0 Jun 27 07:30 2021-06-27-073005-gravity.db.backup
0 Jun 27 10:01 2021-06-27-100006-gravity.db.backup
0 Jun 27 11:31 2021-06-27-113005-gravity.db.backup
0 Jun 27 12:31 2021-06-27-123005-gravity.db.backup
0 Jun 27 14:01 2021-06-27-140005-gravity.db.backup
0 Jun 27 15:01 2021-06-27-150006-gravity.db.backup
0 Jun 27 15:31 2021-06-27-153006-gravity.db.backup
0 Jun 27 16:31 2021-06-27-163005-gravity.db.backup
0 Jun 27 17:01 2021-06-27-170005-gravity.db.backup
0 Jun 27 17:31 2021-06-27-173005-gravity.db.backup
0 Jun 27 18:01 2021-06-27-180005-gravity.db.backup
0 Jun 27 18:31 2021-06-27-183005-gravity.db.backup
0 Jun 27 20:01 2021-06-27-200005-gravity.db.backup
0 Jun 27 20:31 2021-06-27-203006-gravity.db.backup
0 Jun 27 21:31 2021-06-27-213005-gravity.db.backup
0 Jun 27 22:31 2021-06-27-223005-gravity.db.backup
0 Jun 27 23:01 2021-06-27-230006-gravity.db.backup
0 Jun 27 23:31 2021-06-27-233005-gravity.db.backup
0 Jun 28 00:01 2021-06-28-000006-gravity.db.backup
0 Jun 28 01:01 2021-06-28-010006-gravity.db.backup
0 Jun 28 01:31 2021-06-28-013005-gravity.db.backup
0 Jun 28 02:01 2021-06-28-020005-gravity.db.backup
0 Jun 28 03:01 2021-06-28-030005-gravity.db.backup
0 Jun 28 04:00 2021-06-28-040001-gravity.db.backup
0 Jun 28 06:01 2021-06-28-060005-gravity.db.backup
0 Jun 28 07:01 2021-06-28-070005-gravity.db.backup
0 Jun 28 07:31 2021-06-28-073005-gravity.db.backup
0 Jun 28 08:01 2021-06-28-080005-gravity.db.backup
0 Jun 28 08:31 2021-06-28-083005-gravity.db.backup
0 Jun 28 09:01 2021-06-28-090005-gravity.db.backup
0 Jun 28 09:31 2021-06-28-093005-gravity.db.backup
0 Jun 28 10:01 2021-06-28-100005-gravity.db.backup
0 Jun 28 11:31 2021-06-28-113005-gravity.db.backup
0 Jun 28 13:01 2021-06-28-130005-gravity.db.backup
0 Jun 28 14:01 2021-06-28-140005-gravity.db.backup
0 Jun 28 15:01 2021-06-28-150005-gravity.db.backup
0 Jun 28 16:01 2021-06-28-160005-gravity.db.backup
0 Jun 28 16:31 2021-06-28-163005-gravity.db.backup
0 Jun 28 17:01 2021-06-28-170005-gravity.db.backup
0 Jun 28 17:31 2021-06-28-173005-gravity.db.backup
0 Jun 28 19:01 2021-06-28-190005-gravity.db.backup
0 Jun 28 19:31 2021-06-28-193005-gravity.db.backup
0 Jun 28 20:30 2021-06-28-203005-gravity.db.backup
0 Jun 28 22:00 2021-06-28-220005-gravity.db.backup
0 Jun 28 22:30 2021-06-28-223005-gravity.db.backup
0 Jun 29 00:00 2021-06-29-000005-gravity.db.backup
0 Jun 29 00:30 2021-06-29-003005-gravity.db.backup
0 Jun 29 01:30 2021-06-29-013005-gravity.db.backup
0 Jun 29 03:30 2021-06-29-033005-gravity.db.backup
0 Jun 29 04:00 2021-06-29-040001-gravity.db.backup
0 Jun 29 04:30 2021-06-29-043006-gravity.db.backup
0 Jun 29 06:30 2021-06-29-063006-gravity.db.backup
0 Jun 29 07:00 2021-06-29-070005-gravity.db.backup
0 Jun 29 07:30 2021-06-29-073005-gravity.db.backup
0 Jun 29 08:00 2021-06-29-080005-gravity.db.backup
0 Jun 29 08:30 2021-06-29-083005-gravity.db.backup
0 Jun 29 09:00 2021-06-29-090006-gravity.db.backup
0 Jun 29 09:30 2021-06-29-093005-gravity.db.backup
0 Jun 29 12:00 2021-06-29-120005-gravity.db.backup
0 Jun 29 12:30 2021-06-29-123005-gravity.db.backup
0 Jun 29 14:00 2021-06-29-140006-gravity.db.backup
0 Jun 29 14:30 2021-06-29-143005-gravity.db.backup
0 Jun 29 16:00 2021-06-29-160005-gravity.db.backup
0 Jun 29 16:30 2021-06-29-163006-gravity.db.backup
0 Jun 29 17:30 2021-06-29-173006-gravity.db.backup
0 Jun 29 18:00 2021-06-29-180005-gravity.db.backup
0 Jun 29 18:30 2021-06-29-183006-gravity.db.backup
0 Jun 29 22:00 2021-06-29-220005-gravity.db.backup
0 Jun 29 23:00 2021-06-29-230005-gravity.db.backup
0 Jun 29 23:30 2021-06-29-233006-gravity.db.backup
0 Jun 30 00:00 2021-06-30-000005-gravity.db.backup
0 Jun 30 01:00 2021-06-30-010005-gravity.db.backup
0 Jun 30 01:30 2021-06-30-013005-gravity.db.backup
0 Jun 30 02:00 2021-06-30-020005-gravity.db.backup
0 Jun 30 03:30 2021-06-30-033005-gravity.db.backup
0 Jun 30 04:00 2021-06-30-040001-gravity.db.backup
0 Jun 30 04:30 2021-06-30-043005-gravity.db.backup
0 Jun 30 05:00 2021-06-30-050005-gravity.db.backup
0 Jun 30 05:30 2021-06-30-053006-gravity.db.backup
0 Jun 30 06:30 2021-06-30-063006-gravity.db.backup
0 Jun 30 11:00 2021-06-30-110005-gravity.db.backup
0 Jun 30 16:30 2021-06-30-163005-gravity.db.backup
183 Feb 15 21:39 BACKUP.md
0 Jul 4 10:45 backups.list
0 Jan 7 15:08 custom.list.pull
0 Jan 7 16:21 custom.list.push
635707392 Jun 12 22:01 gravity.db.pull
635707392 Jun 13 03:32 gravity.db.push
158666752 Jan 7 15:23 gravity.db.push_bak

@bennydiamond
Copy link
Contributor

Same issue, on both fallback units (yes I have 3 pi-holes). Backup files just fill up fs.

vmstan pushed a commit that referenced this issue Jul 19, 2021
vmstan added a commit that referenced this issue Jul 19, 2021
* Add the addition of an Environment Path variable in Crontab (#212)

* Add detection of missing path components and addition of path to crontab

* Fix bug where \n is inserted literally

* Fix `find` command invoke (Issue #220) (#223)

* 3.4.5

Co-authored-by: Michael Thompson <[email protected]>
Co-authored-by: benjaminfd <[email protected]>
Co-authored-by: Michael Stanclift <[email protected]>
@tamorgen
Copy link

tamorgen commented Aug 5, 2021

Sorry, adding onto the pile. My Raspberry Pi 4 running only Homebridge and PiHole (with Gravity Sync), stopped responding sometime in the past week or two. I logged in to find the root directory at 100%. Some searching revealed that Gravity-Sync's logs and backups had filled up the partition on a 64 GB SD card (after clearing past months, only 3.7 is used now). Is there a way to automatically clear out old backups and logs to prevent this?

@bennydiamond
Copy link
Contributor

Sorry, adding onto the pile. My Raspberry Pi 4 running only Homebridge and PiHole (with Gravity Sync), stopped responding sometime in the past week or two. I logged in to find the root directory at 100%. Some searching revealed that Gravity-Sync's logs and backups had filled up the partition on a 64 GB SD card (after clearing past months, only 3.7 is used now). Is there a way to automatically clear out old backups and logs to prevent this?

Version 3.4.5 includes the fix for the backup files not being removed. Make sure you are on the latest release.

@tamorgen
Copy link

tamorgen commented Aug 5, 2021

Version 3.4.5 includes the fix for the backup files not being removed. Make sure you are on the latest release.

Excellent. Just ran the update command. Very quick!

@dwedia
Copy link

dwedia commented Aug 16, 2021

Just noticed this problem today. I had 26Gigs of backups taking up space on my poor secondary pihole.

Thanks for the fix =)

@tapufd
Copy link

tapufd commented Sep 2, 2021

Still the same issue for me.
I'm on the latest version 3.4.5

@tapufd
Copy link

tapufd commented Sep 2, 2021

manual pull did cleanup the backups now.
via cron job it didn't.
keeping an eye on it now...

@ytsejam1138
Copy link

Having the same issue. Running latest version 3.4.5

@vmstan vmstan mentioned this issue Sep 4, 2021
@vmstan
Copy link
Owner

vmstan commented Sep 6, 2021

If you manually run the backup does the job complete without errors?

@tapufd
Copy link

tapufd commented Sep 7, 2021

If I run manually, all seems to work fine, also the cleanup of the backups.
Via cron job it doesn't.
Everything runs now as root.

I see that the output of a manual run vs a cron job is totally different...
It also looks like the con job never has a complete successful run and tries every 15 min with also creating a new backup every.

MANUAL:
[�[0;95m∞�[0m] �[1mInitalizing Gravity Sync (3.4.5)�[0m
[�[0;96me�[0m] Loading gravity-sync.conf
[�[0;92m✓�[0m] Loading gravity-sync.conf
[�[0;96me�[0m] Evaluating arguments
[�[0;92m✓�[0m] Evaluating arguments: PULL
[�[0;93mi�[0m] �[0;93mRemote Pi-hole: [email protected]�[0m
[�[0;96me�[0m] Validating OpenSSH client
[�[0;96me�[0m] Validating RSYNC client
[�[0;96me�[0m] Validating Gravity Sync folders on XYZ
[�[0;96me�[0m] Validating configuration of Pi-hole
[�[0;96me�[0m] Validating configuration of SQLITE3
[�[0;96me�[0m] Connecting to x.x.x.x
[�[0;92m✓�[0m] Connecting to x.x.x.x
[�[0;96me�[0m] Hashing the primary Domain Database
[�[0;92m✓�[0m] Hashing the primary Domain Database
[�[0;96me�[0m] Comparing to the secondary Domain Database
[�[0;92m✓�[0m] Comparing to the secondary Domain Database
[�[0;96me�[0m] Hashing the primary Local DNS Records
[�[0;92m✓�[0m] Hashing the primary Local DNS Records
[�[0;96me�[0m] Comparing to the secondary Local DNS Records
[�[0;92m✓�[0m] Comparing to the secondary Local DNS Records
[�[0;93mi�[0m] �[0;93mNo replication is required at this time�[0m
[�[0;96me�[0m] Purging redundant backups on secondary Pi-hole instance
[�[0;92m✓�[0m] Purging redundant backups on secondary Pi-hole instance
[�[0;93mi�[0m] �[0;93m0 days of backups remain (621M)�[0m
[�[0;95m∞�[0m] �[1mGravity Sync PULL aborted after 0 seconds�[0m

CRON JOB:
[�[0;95m∞�[0m] �[1mInitalizing Gravity Sync (3.4.5)�[0m
[�[0;96me�[0m] Loading gravity-sync.conf
[�[0;92m✓�[0m] Loading gravity-sync.conf
[�[0;96me�[0m] Evaluating arguments
[�[0;92m✓�[0m] Evaluating arguments: PULL
[�[0;93mi�[0m] �[0;93mRemote Pi-hole: [email protected]�[0m
[�[0;96me�[0m] Validating OpenSSH client
[�[0;96me�[0m] Validating RSYNC client
[�[0;96me�[0m] Validating Gravity Sync folders on XYZ
[�[0;96me�[0m] Validating configuration of Pi-hole
[�[0;96me�[0m] Validating configuration of SQLITE3
[�[0;96me�[0m] Connecting to x.x.x.x
[�[0;92m✓�[0m] Connecting to x.x.x.x
[�[0;96me�[0m] Hashing the primary Domain Database
[�[0;92m✓�[0m] Hashing the primary Domain Database
[�[0;96me�[0m] Comparing to the secondary Domain Database
[�[0;92m✓�[0m] Comparing to the secondary Domain Database
[�[0;95m!�[0m] �[0;95mDifferences detected in the Domain Database�[0m
[�[0;96me�[0m] Hashing the primary Local DNS Records
[�[0;92m✓�[0m] Hashing the primary Local DNS Records
[�[0;96me�[0m] Comparing to the secondary Local DNS Records
[�[0;92m✓�[0m] Comparing to the secondary Local DNS Records
[�[0;95m!�[0m] �[0;95mReplication of Pi-hole settings is required�[0m
[�[0;96me�[0m] Performing backup of secondary Domain Database
[�[0;92m✓�[0m] Performing backup of secondary Domain Database
[�[0;96me�[0m] Performing backup of primary Domain Database
[�[0;92m✓�[0m] Performing backup of primary Domain Database
[�[0;96me�[0m] Checking Domain Database backup integrity
[�[0;92m✓�[0m] Checking Domain Database backup integrity
[�[0;96me�[0m] Pulling the primary Domain Database
[�[0;92m✓�[0m] Pulling the primary Domain Database
[�[0;96me�[0m] Replacing the secondary Domain Database
[�[0;92m✓�[0m] Replacing the secondary Domain Database
[�[0;96me�[0m] Validating file ownership on Domain Database
[�[0;92m✓�[0m] Validating file ownership on Domain Database
[�[0;96me�[0m] Validating file permissions on of Domain Database
[�[0;92m✓�[0m] Validating file permissions on of Domain Database
[�[0;96me�[0m] Performing backup of secondary Local DNS Records
[�[0;92m✓�[0m] Performing backup of secondary Local DNS Records
[�[0;96me�[0m] Performing backup of primary Local DNS Records
[�[0;92m✓�[0m] Performing backup of primary Local DNS Records
[�[0;96me�[0m] Pulling the primary Local DNS Records
[�[0;92m✓�[0m] Pulling the primary Local DNS Records
[�[0;96me�[0m] Replacing the secondary Local DNS Records
[�[0;92m✓�[0m] Replacing the secondary Local DNS Records
[�[0;96me�[0m] Validating file ownership on Local DNS Records
[�[0;92m✓�[0m] Validating file ownership on Local DNS Records
[�[0;96me�[0m] Validating file permissions on Local DNS Records
[�[0;92m✓�[0m] Validating file permissions on Local DNS Records
[�[0;93mi�[0m] �[0;93mIsolating regeneration pathways�[0m
[�[0;96me�[0m] Updating secondary FTLDNS configuration
[�[0;92m✓�[0m] Updating secondary FTLDNS configuration
[�[0;96me�[0m] Reloading secondary FTLDNS services
[�[0;91m✗�[0m] Reloading secondary FTLDNS services

@vmstan vmstan self-assigned this Sep 7, 2021
@vmstan vmstan added the bug Something isn't working label Sep 7, 2021
@vmstan
Copy link
Owner

vmstan commented Sep 7, 2021

Please update to 3.4.6 and see if issues persist.

@abjoseph
Copy link

Same issue here, currently on 3.4.7 and cron job execution does not purge backups...running the sync manually does purge all backups. I have BACKUP_RETAIN set to 0 in gravity-sync.conf file.

@vmstan
Copy link
Owner

vmstan commented Sep 13, 2021

Same issue here, currently on 3.4.7 and cron job execution does not purge backups...running the sync manually does purge all backups. I have BACKUP_RETAIN set to 0 in gravity-sync.conf file.

@abjoseph can you post the output of ./gravity-sync.sh info for me?

@abjoseph
Copy link

abjoseph commented Sep 13, 2021

@vmstan Update: It seems to be working now, working in the sense that the backups are purged (with BACKUP_RETAIN=0) after having ran the ./gravity-sync.sh script without any arguments and having it do a sync. Previously, when I initially updated gravity-sync and did a reboot, it did not purge the backups on any of the subsequent cron executions.

P.S I'm not sure if setting BACKUP_RETAIN=0 just prevents it from creating any new backups as opposed to purging any existing backups and then creating one new one. Maybe I'll trying testing BACKUP_RETAIN=1, let than run for a while then change BACKUP_RETAIN=0, reboot and see if the script picks up the new value and begins purging the backups on its own without me running the gravity-sync.sh script manually.

@abjoseph
Copy link

abjoseph commented Sep 13, 2021

Also output of ./gravity-sync.sh info: (FYI - Pi-hole instance is running in a LXC container within Proxmox, as privileged.)

root@pihole-b:~# ./gravity-sync/gravity-sync.sh info
[∞] Initalizing Gravity Sync (3.4.7)
[✓] Loading gravity-sync.conf
[✓] Evaluating arguments: INFO
========================================================
Local Software Versions
Gravity Sync 3.4.7
Pi-hole
  Pi-hole version is v5.3.1 (Latest: v5.4)
  AdminLTE version is v5.5.1 (Latest: v5.6)
  FTL version is v5.8.1 (Latest: v5.9)
Linux 5.11.22-3-pve x86_64
bash 5.0.17(1)-release
OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f  31 Mar 2020
rsync  version 3.1.3  protocol version 31
sqlite3 3.31.1 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt1
Sudo version 1.8.31
git version 2.25.1

Local/Secondary Instance Settings
Local Hostname: pihole-b
Local Pi-hole Type: default
Local Pi-hole Config Directory: /etc/pihole
Local DNSMASQ Config Directory: /etc/dnsmasq.d
Local Gravity Sync Directory: /root/gravity-sync
Local Pi-hole Binary Directory: /usr/local/bin/pihole
Local File Owner Settings: pihole:pihole
DNS Replication: Enabled (default)
CNAME Replication: Enabled (custom)
Verify Operations: Disabled (custom)
Ping Test: Enabled (default)
Backup Retention: 0 days (custom)
Backup Folder Size: 277K

Remote/Primary Instance Settings
Remote Hostname/IP: 192.168.1.11
Remote Username: root
Remote Pi-hole Type: default
Remote Pi-hole Config Directory: /etc/pihole
Remote DNSMASQ Config Directory: /etc/dnsmasq.d
Remote Pi-hole Binary Directory: /usr/local/bin/pihole
Remote File Owner Settings: pihole:pihole
========================================================
[∞] Gravity Sync INFO aborted after 0 seconds

@podkilla
Copy link

Backups still cluttering the disk - doesnt matter whether i set BACKUP_RETAIN to '1' or '0'.

@ytsejam1138
Copy link

Still experiencing the same thing. Just had to delete over 10 backups from last night after my weekly backup ran. BACKUP_RETAIN is set to '0'. It is syncing my adlists along with my blacklists and whitelists.

@tapufd
Copy link

tapufd commented Oct 10, 2021

Same issue here. (thought it was solved)
The issue seems to be only there when running via the cron job.

@apveening
Copy link

On a related note: What are the possibilities for a setting to put those backups in another location like an attached HDD? Most of us use Pi-Hole and Gravity-Sync on Raspberry Pis and most likely with SD cards, which don't take kindly to massive rewrites like these backups.
I can probably manage to create a symlink, but I don't think I am in anything resembling a majority or even a large minority with that.

@litebright
Copy link

This is still an issue. I believe I've found the problem in the includes/gs-backup.sh file.
Line 19, which calls the cleanup function of the backups is commented out, so it never runs.

17 backup_local_custom
18 backup_local_cname
19 # backup_cleanup
20
21 logs_export

@modem7
Copy link

modem7 commented Nov 16, 2021

This is still an issue. I believe I've found the problem in the includes/gs-backup.sh file. Line 19, which calls the cleanup function of the backups is commented out, so it never runs.

17 backup_local_custom 18 backup_local_cname 19 # backup_cleanup 20 21 logs_export

@litebright it might be worthwhile to create a pull request. This was introduced in 3.4.6 here

@modem7
Copy link

modem7 commented Nov 20, 2021

Can confirm I'm also getting this behaviour, even with backup_cleanup uncommented:

image

@vmstan
Copy link
Owner

vmstan commented Dec 14, 2021

I wish I had an answer for everyone on this, but it seems to consistently be cron not properly removing the files while a manual sync job does, and no other function of the script doesn't run correctly via cron. It's also not triggering for me on my systems.

@vmstan
Copy link
Owner

vmstan commented Dec 14, 2021

Anyone impacted by this, can you post the output of find -version for me?

@modem7
Copy link

modem7 commented Dec 14, 2021

Anyone impacted by this, can you post the output of find -version for me?

find (GNU findutils) 4.7.0

And I'm on

Ubuntu 20.04.3 LTS

@vmstan
Copy link
Owner

vmstan commented Dec 14, 2021

Alright I figured that was a long shot, same as what I'm testing on.

@modem7
Copy link

modem7 commented Dec 14, 2021

Alright I figured that was a long shot, same as what I'm testing on.

Would it be worthwhile being a bit hacky, and creating a separate function for manual backups, appending _manual to the end or similar?

That way, the manual and automated backups would 1. be separate and easily identifiable and 2. not be affected by one another when pruning occurs.

@podkilla
Copy link

find (GNU findutils) 4.6.0.225-235f
on
Debian GNU/Linux 10 (buster)

@eskiiom
Copy link

eskiiom commented Dec 17, 2021

Hi @vmstan
I have the same issue here on GS 3.4.7

find (GNU findutils) 4.8.0
on LXC
Debian GNU/Linux 11

Thanks !

@H34dl3ss
Copy link
Author

H34dl3ss commented Dec 20, 2021

I have
find (GNU findutils) 4.6.0.225-235f
on
Raspbian GNU/Linux 10

@Madchristian
Copy link

find (GNU findutils) 4.8.0
on Raspian

@SecurityWho
Copy link

SecurityWho commented Jan 2, 2022

I do have the same issue and it looks like that the old issue #193 is somewhat similar - because I do get the "[✗] Reloading secondary FTLDNS services" error only, when the backups are not deleted.
What I find interessting, is that I dont have this issue all the time - sometimes it works for days, but sometimes I have to manually execute the command twice a day.

As a workaround for not filling up my disk, I added an contab entry to delete backups that are older than 59 minutes. Because my pihole stopped working several times - because auf 100% diskusage ;-).

*/15 * * * * /usr/bin/find /root/gravity-sync/backup/ -name '*.backup' -mmin +59 -delete
--> you need to adjust the path to the backup for your needs.

find -version
find (GNU findutils) 4.8.0

UPDATE:
I found, that the new entrys are synced and visible in the Admin WebGUI - but they are NOT active and resolvable. I created an new crontab entry to automatically restart the piholeFTP service. After that the entrys worked just fine.

5 * * * * /usr/sbin/service pihole-FTL restart >/dev/null 2>&1

--> Hope that this can be fixed in the near future.

@SecurityWho
Copy link

Quick Update from my side - this seems to be fixed with version 3.4.8

@vmstan
Copy link
Owner

vmstan commented Jan 14, 2022

Interested to see if anyone else who updates gets this corrected as well.

@ytsejam1138
Copy link

I just had to delete 80 backups, 20 Gigs worth all from today. Version 3.4.8

@ytsejam1138
Copy link

Running the automate command only gives the option for how often to run and then exits out. Could this be part of the problem or is this normal in the newer versions?

@rtc2022
Copy link

rtc2022 commented Jan 26, 2022

The problem appears to have been resolved with version 3.4.8, files are purged. However, the last line in /gravity-sync/logs/gravity-sync.cron indicates "Gravity Sync PULL aborted after 1 seconds". My "BACKUP_RETAIN='0'" and I am running on Debian 12 (Bullseye).

@vmstan
Copy link
Owner

vmstan commented Jan 26, 2022

The problem appears to have been resolved with version 3.4.8, files are purged. However, the last line in /gravity-sync/logs/gravity-sync.cron indicates "Gravity Sync PULL aborted after 1 seconds". My "BACKUP_RETAIN='0'" and I am running on Debian 12 (Bullseye).

If your last cron job didn't detect a change to sync, it still says aborted. I should probably change it to like "has nothing to do" to be more clear.

@vmstan
Copy link
Owner

vmstan commented Jan 26, 2022

I just had to delete 80 backups, 20 Gigs worth all from today. Version 3.4.8

How big is your database (one backup file?)

@ytsejam1138
Copy link

Roughly 250Mb

I just had to delete 80 backups, 20 Gigs worth all from today. Version 3.4.8

How big is your database (one backup file?)

Roughly 250Mb per file.

@rtc2022
Copy link

rtc2022 commented Jan 27, 2022

Sad to report issue does not appear to be resolved with 3.4.8. 23 hours after my previous post and a review of the backup directory, backups are noted every 30 minutes, and "my" total sum is 3.0 GB.

For your review and analysis, backups started at 0130 CST and my crontab -e is as follows:
*/30 * * * * /bin/bash /gravity-sync/gravity-sync.sh pull > /gravity-sync/logs/gravity-sync.cron.
Not sure why 0130, when I performed a manual "PULL" the system (allegedly) remained purged until 0130 and continues to backup even now. I do plan on doing a manual pull, and repeating the test again, any new developments will be noted in a future post.

Other cron jobs (below) do not conflict with gravity-sync but are provided as reference.
10 1 * * * xxxxxx /baseline/pi_update.sh
00 3 * * * xxxxxx /baseline/log_version.sh

A review of the gravity-sync.cron file reveals the following, note there are no "purging" backups noted even though my "BACKUP_RETAIN='0'".
[∞] Initalizing Gravity Sync (3.4.8)
[e] Loading gravity-sync.conf
[e] Evaluating arguments
[i] Primary Pi-hole: [email protected]
[e] Validating configuration of OpenSSH
[e] Validating configuration of RSYNC
[e] Validating Gravity Sync folders on mnsb
[e] Validating configuration of Pi-hole
[e] Validating configuration of SQLITE3
[e] Connecting to 192.168.100.2
[e] Hashing the primary Domain Database
[e] Comparing to the secondary Domain Database
[!] Differences detected in the Domain Database
[e] Hashing the primary Local DNS Records
[e] Comparing to the secondary Local DNS Records
[!] Replication of Pi-hole settings is required
[e] Performing backup of secondary Domain Database
[e] Performing backup of primary Domain Database
[e] Checking Domain Database backup integrity
[e] Pulling the primary Domain Database
[e] Replacing the secondary Domain Database
[e] Validating file ownership on Domain Database
[e] Validating file permissions on of Domain Database
[e] Performing backup of secondary Local DNS Records
[e] Performing backup of primary Local DNS Records
[e] Pulling the primary Local DNS Records
[e] Replacing the secondary Local DNS Records
[e] Validating file ownership on Local DNS Records
[e] Validating file permissions on Local DNS Records
[i] Isolating regeneration pathways
[e] Updating secondary FTLDNS configuration
[e] Reloading secondary FTLDNS services

@rtc2022
Copy link

rtc2022 commented Jan 30, 2022

Temporary Solution ...

The last two days produced the exact same results as previously posted, starting at 0130. Here is how I got around the issue to prevent the backups from saving based on my settings: "BACKUP_RETAIN='0'". I will continue to test and revert back when this issue is resolved.

Removed content from crontab -e (tmp crontab) and pasted it into /etc/crontab...

/etc/crontab
*/30 * * * * root /gravity-sync/gravity-sync.sh pull > /gravity-sync/logs/gravity-sync.cron

@axl7777
Copy link

axl7777 commented Feb 7, 2022

noticed line 19 in gs-backup.sh is commented out

@SaltireSoul
Copy link

Correct me if I'm wrong but I think there has been a misunderstanding of pull / push (myself included), it should be best described as a forced pull / push.

Pull / Push performs a backup first, then rsyncs to pihole, no changes check is performed. This means changing the cron from smart to pull for 1-way syncing causes (assuming it runs every 15m with 3 day retention) 96 backups a day and 288 backups after 3 days. At this point gravity-sync would start deleting old backups.

Only Smart sync checks for changes before performing backup & rsync.
@vmstan Would it be possible to add smart-pull only / smart-push only?

The task_backup function in gs-backup.sh isn't used during sync, but only when manually running "gravity-sync backup", so "# backup_cleanup" would have no effect.

@nnleaf
Copy link

nnleaf commented Feb 24, 2022

Hi, I've been running PiHole on Debian 11, running Gravity Syink v3.4.8.

Like the first post, my /gravity-sync/backup folder is filled with custom.list.backup and gravity.db.backup files.. I remember back a week or so ago, I ran gravity-sync.sh automate while doing a PiHole update as part of maintenance. I don't think I've used that command since I installed Gravity Sync.. I set it for 5 minutes. My current crontab =

*/5 * * * * /bin/bash /home/nn/gravity-sync/gravity-sync.sh smart > /home/nn/gravity-sync/logs/gravity-sync.cron

I re-ran gravity-sync config with the only customized setting is BACKUP_RETAIN='1'

I also do have backups weekly for the current month, so I can pull a known working configuration from 2-3 weeks back if there's anything on it needed to check to help with figuring out what went wrong. I'm going to delete all the files in /backup/ then monitor this VM to see if it prunes properly.

@vmstan vmstan linked a pull request Feb 25, 2022 that will close this issue
@vmstan
Copy link
Owner

vmstan commented Feb 25, 2022

@vmstan
Copy link
Owner

vmstan commented Feb 25, 2022

Only Smart sync checks for changes before performing backup & rsync. @vmstan Would it be possible to add smart-pull only / smart-push only?

The push and pull operations are "semi-smart" already. It will look and see if there are changes between the components, and only do something if it does detect. However if it detects any changes it will attempt to move all three managed components in the direction indicated.

@Zanathoz
Copy link

Zanathoz commented Jun 24, 2022

I'm hitting this issue as well on 4.0.4 running Fedora 36 in podman.

Backup Cleanup was disabled in backup.sh but made no change after enabling.

I disabled the job last night in crontab -e as @rtc2022 mentions above and the backups stopped creating overnight.

Unfortunately moving the job from crontab -e to /etc/crontab has the same effect as disabling in crontab -e and the backups won't run.

For now, I've re-enabled the crontab -e sync job and added an additional manual cleanup job to /etc/crontab as @SecurityWho mentioned above until this is resolved. I did modify his to keep the 5 newest files and delete all the rest instead of clearing every hour (as my database doesn't change very often). Change the variable under | head -n -X | to the amount of new backups you'd like to keep.
/15 * * * * /usr/bin/find /root/gravity-sync/backup/ -name '.backup' | head -n -5 | xargs rm

Also, seems the link you posted above is dead or incorrect - https://github.com/vmstan/gravity-sync/discussions/295

@vmstan
Copy link
Owner

vmstan commented Jun 24, 2022

@Zanathoz that isn’t how 4.x works. I would suggest removing your existing install, including any crontab related to Gravity Sync, and reinstalling.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.