-
Notifications
You must be signed in to change notification settings - Fork 21
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
Two new functions: "Backup" and "Recover" #57
base: master
Are you sure you want to change the base?
Conversation
Thanks for the great work! Unfortunately we're in the middle of a rewrite to another language, most likely Nushell, and you can find the progress at #52.
…-------- Original Message --------
On 2/13/25 18:11, devtracer wrote:
Hello Rhino Linux Team,
I’d like to submit this pull request to introduce two new utilities: rpk backup and rpk recover. Below are the details of their functionality and rationale.
Intent
The rpk backup utility records the names of all installed packages (from different sources) to create a backup for a specific device. The rpk recover command reads this backup file and installs any missing packages on another system.
Context
This update enables users to log and save their installed package data, allowing them to replicate the same environment on another device using the recover command. This is particularly useful for migration, disaster recovery, or consistent setup across multiple machines.
Logic of backup
- The user selects where to save the backup file (e.g., a default path with a timestamped filename or a custom path/name).
- The utility verifies the file’s safety before writing.
- Installed packages are collected and categorized by their package manager (e.g., dpkg, snap).
[username] sudo ./rhino-pkg backup
The backup file's location: '/rhino-pkg_backup_20250213_172315.txt'
Continue (y), or choose your own .txt file (S)? (y/S) y
Creating the file: /rhino-pkg_backup_20250213_172315.txt
Using the file: /rhino-pkg_backup_20250213_172315.txt
Backup location: /rhino-pkg_backup_20250213_172315.txt
Starting backup process...
Collecting installed package names...
Backup completed successfully!
Backup saved to: /rhino-pkg_backup_20250213_172315.txt
SHA256: 9e382d149b9f0e06e120399f86728bf14508670fe4f3f21399f0e614677a23e0
The logic of recover
- Validates the backup file’s readability and integrity.
- Installs missing packages using their respective package managers.
- Displays a summary of failed installations.
- Prompts the user to run a system update and cleanup post-recovery.
$ sudo ./rhino-pkg recover /rhino-pkg_backup_20250213_172315.txt
Using the file: /rhino-pkg_backup_20250213_172315.txt
Do you want to recover files by downloading packages again (WARNING: YOU CANNOT CANCEL THE OPERATION! Internet bandwidth usage warning!)? (y/N) y
Starting recovery...
Do you want to update first? (y/N) N
Skipping update.
Recovering dpkg/apt packages...
accountsservice is already the newest version (23.13.9-7ubuntu1).
Summary:
Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
'accountsservice' is installed successfully.
acl is already the newest version (2.3.2-2).
Summary:
Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
'acl' is installed successfully.
adduser is already the newest version (3.137ubuntu2).
Summary:
Upgrading: 0, Installing: 0, Removing: 0, Not Upgrading: 0
'adduser' is installed successfully.
Package adw-gtk-theme is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Error: Package 'adw-gtk-theme' has no installation candidate
Failed to install 'adw-gtk-theme'.
Package adw-gtk3 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
Error: Package 'adw-gtk3' has no installation candidate
Failed to install 'adw-gtk3'.
.
.
.
Errors:
Failed to install the following dpkg/apt packages:
- adw-gtk-theme
- adw-gtk3
- appmenu-registrar
- celeste
- discord
.
.
.
Failed to install the following Snap packages:
- libsnapd-glib-2-1
- libsnappy1v5
Next Steps
This feature is in beta, and I welcome feedback on:
- Naming conventions (e.g., backup/recover vs. save/restore)
- Code structure improvements
- Edge cases or security considerations
Let me know if any adjustments are needed before merging. I’m happy to iterate further!
Best regards,
***@***.***(https://github.com/devtracer)
---------------------------------------------------------------
You can view, comment on, or merge this pull request online at:
#57
Commit Summary
- [c11a06f](c11a06f) modified: rhino-pkg
- [8ad745e](8ad745e) modified: rhino-pkg
- [dcdf60f](dcdf60f) modified: rhino-pkg
- [ab73b46](ab73b46) modified: rhino-pkg
- [989d0ae](989d0ae) modified: rhino-pkg
- [072bbf4](072bbf4) modified: rhino-pkg
- [fd5987b](fd5987b) Update README.md
- [ebec4fb](ebec4fb) modified: rhino-pkg
- [f8ae6f4](f8ae6f4) modified: rhino-pkg
- [9e50023](9e50023) modified: rhino-pkg
- [c664cde](c664cde) modified: README.md
File Changes
([2 files](https://github.com/rhino-linux/rhino-pkg/pull/57/files))
- M [README.md](https://github.com/rhino-linux/rhino-pkg/pull/57/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5) (11)
- M [rhino-pkg](https://github.com/rhino-linux/rhino-pkg/pull/57/files#diff-3c2add47754feffb79b58254b5440b8facc77bcf1a5118e6fc905f78cd56c571) (221)
Patch Links:
- https://github.com/rhino-linux/rhino-pkg/pull/57.patch
- https://github.com/rhino-linux/rhino-pkg/pull/57.diff
—
Reply to this email directly, [view it on GitHub](#57), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AOAFN44UK6NZM44NX6YL3HT2PURDNAVCNFSM6AAAAABXDLCBSKVHI2DSMVQWIX3LMV43ASLTON2WKOZSHA2TEMRZGAZDGNY).
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
We should absolutely add this feature to the rewrite, though. We intended for a very similar concept with https://github.com/rhino-linux/horns, which never came to full fruition. Thank you immensely for this! |
This is absolutely incredible work. I would personally want to see this merged into the current (bash) version of rhino-pkg, and then we port it to the rewrite (whatever language that may be) My concern is that there does not seem to be any handling for Pacstall packages, only apt/snap and flatpak. This would absolutely need to be rectified if this is to be merged into rhino-pkg. |
Additionally there seems to be no handling for Nala. |
Yes absolutely this should be added to the rewrite. Sorry if I didn't mention that in my first message, but that was my intention. |
Thank you for your response, @Elsie19, and I’m glad you liked the project! Regarding the rewrite to Nushell (#52), I’d love to contribute to this effort as well. My idea is to implement the
I’ll share another idea soon. Looking forward to your thoughts! |
Are you familiar with Nushell? |
@oklopfer I’m thrilled to hear you liked the idea! My next suggestion aligns perfectly with this: I’d love to contribute to completing the Horns project. Once finalized, the future We can discuss details like:
Looking forward to collaborating on this! |
I’m not currently familiar with Nushell, but after looking it up, I find it quite interesting and am eager to learn it! |
I'm absolutely delighted to hear that you liked my project! It truly means a lot, and I’d be more than happy to contribute!
Yes, you're completely right and I agree! I’ve included handling for Pacstall packages. Here’s how it works:
Let me know if there’s anything else I can clarify or improve! |
When the recovery process is complete, the code asks the user if they want to run an update and a cleanup as well. If the user agrees, the cleanup process will also be executed. If it's necessary to enforce a cleanup, we can modify the logic accordingly. |
Is the recovery supposed to be prompted throughout? |
Could you clarify further? The recovery process is designed to reinstall the required packages. The code identifies packages under the Pacstall tag and passes them to Pacstall for installation. If there are specific prompts or steps during |
I assume he's talking about the |
Thanks for the explanation. So as it seems, I have to change |
You should use |
Ok, I'll edit the code. Thanks. |
Replaced ```Pacstall -I``` to ```Pacstall -PI```
Hello Rhino Linux Team,
I’d like to submit this pull request to introduce two new utilities:
rpk backup
andrpk recover
. Below are the details of their functionality and rationale.Intent
The
rpk backup
utility records the names of all installed packages (from different sources) to create a backup for a specific device. Therpk recover
command reads this backup file and installs any missing packages on another system.Context
This update enables users to log and save their installed package data, allowing them to replicate the same environment on another device using the
recover
command. This is particularly useful for migration, disaster recovery, or consistent setup across multiple machines.Logic of
backup
dpkg
,snap
).The logic of
recover
Errors:
Next Steps
This feature is in beta, and I welcome feedback on:
Let me know if any adjustments are needed before merging. I’m happy to iterate further!
Best regards,
@devtracer