Skip to content
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

CL run lightning-cli backup-compact regularly #2869

Closed
openoms opened this issue Jan 6, 2022 · 5 comments
Closed

CL run lightning-cli backup-compact regularly #2869

openoms opened this issue Jan 6, 2022 · 5 comments
Milestone

Comments

@openoms
Copy link
Collaborator

openoms commented Jan 6, 2022

The CL database backup can fill up the SDcard, but compacting is efficient:

$ config.scripts/cl-plugin.backup.sh backup-compact
/home/bitcoin/.lightning/bitcoin/lightningd.sqlite3
#  Running -cli backup-compact ...
{
   "before": {
      "backupsize": 1798100953,
      "version_count": 198720
   },
   "after": {
      "version_count": 2,
      "backupsize": 130356568
   }
}

Went from 1.7 GB to 130MB.
the actual database on the same node:

$ sudo du -h /mnt/hdd/app-data/.lightning/bitcoin/lightningd.sqlite3
125M	/mnt/hdd/app-data/.lightning/bitcoin/lightningd.sqlite3

Can use
config.scripts/cl-plugin.backup.sh backup-compact

or just:

lightning-cli backup-compact

@openoms
Copy link
Collaborator Author

openoms commented Jan 6, 2022

Since CL does not need to stop for this it could be a cronjob installed with the backup plugin.

openoms added a commit that referenced this issue Jan 6, 2022
#2869 using the admin crontab,  check with:
crontab -u admin -l
@openoms openoms added this to the 1.7.2 Release milestone Jan 6, 2022
@openoms openoms added the final testing was fixed - needs testing label Jan 6, 2022
openoms added a commit that referenced this issue Jan 6, 2022
#2869 using the admin crontab,  check with:
crontab -u admin -l
@rootzoll
Copy link
Collaborator

@openoms do you see this issue well tested enough to close for release?

@rootzoll rootzoll reopened this Feb 17, 2022
@openoms
Copy link
Collaborator Author

openoms commented Feb 17, 2022

Yes. Complete with fb65c0e
I am running with the settings since the commits, had no issues.

@openoms
Copy link
Collaborator Author

openoms commented Feb 17, 2022

Just did a manual run successfully too:

₿ ./config.scripts/cl-plugin.backup.sh backup-compact
152 MB /home/bitcoin/.lightning/bitcoin/lightningd.sqlite3
532 MB /home/bitcoin/lightningd.sqlite3.backup
# The backup is 200MB+ larger than the db, running 'lightning-cli backup-compact' ...
{
   "before": {
      "backupsize": 557584828,
      "version_count": 41842
   },
   "after": {
      "version_count": 2,
      "backupsize": 158835366
   }
}

@rootzoll
Copy link
Collaborator

Perfect. So closing issue for release.

@rootzoll rootzoll removed the final testing was fixed - needs testing label Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants