syssetup system snapshot tool
Find a file
2024-05-23 18:49:43 -05:00
.gitignore gitignore updated 2024-05-21 15:17:52 -05:00
bootstrap.wrt.ash save point for openwrt support addition 2023-10-06 22:21:58 -05:00
check.bash bug fix attempts 2024-02-22 21:28:37 -06:00
hostsums Save point trying to fix the /etc overwrite problem 2024-05-23 17:45:46 -05:00
installed.bash save point for openwrt support addition 2023-10-06 22:21:58 -05:00
LICENSE Public release clean up 2023-09-20 21:16:47 -05:00
os_probe.bash save point for openwrt support addition 2023-10-06 22:21:58 -05:00
pkgsum Save point trying to fix the /etc overwrite problem 2024-05-23 17:45:46 -05:00
README.md changed my copy method 2024-05-21 19:44:21 -05:00
restore.arch.bash Save point trying to fix the /etc overwrite problem 2024-05-23 17:45:46 -05:00
restore.deb.bash more tinkering 2024-05-23 18:31:30 -05:00
restore.lib.bash addition to make debian restores faster 2024-02-22 23:39:30 -06:00
restore.wrt.bash save point adding exclusions 2023-10-27 16:34:59 -05:00
syssetup.bash more mucking 2024-05-23 18:49:43 -05:00
test.bash apt restore fix for missing pkgs 2024-02-21 17:21:07 -06:00
verify.bash save 2024-05-23 18:31:54 -05:00

syssetup

This system was created to allow of easy recreation or restoration of a existing system. This is not a backup application, nor does it create a image in the sense of a full disk image. It creates a snapshot of the current system configuration and installed packages. Once this information is collected it is packaged into standalone self extracting restore archive. It does this by copying your /etc folder and generating a list of installed programs via the package manager on the system. These are then packaged into executable you can copy and run on another system. Great for duplicating a say a raspberry pi configuration. Works well for VPS systems as well, especially when you just need to do a clean reinstall.

Scripts

check.bash - checks if makeself is installed. Can be installed via normal methods or via this script os_probe.bash - checks if we are on a debian or arch based distro via looking for apt or pacman restore.*.bash - these are scripts specific to debian or arch bootstrap.wrt.ash - Specifically for OpenWRT, made specifically to be compatable with bustbox's ash shell. It will check for and if needed install bash before running the rest. syssetup.bash - The main program test.bash - Some file I was using to test something, you can ignore it

Plans

To add flatpak support for making it more usable for desktops. Also at one point create a custom replacement for makeself thats specific to this script.

Notes May 21 2024

So allot more testing and work has gotten this thing running well. Debian based is the best supported. Though Arch did work according to my tests. I will need do testing for OpenWRT at a more intensive level though. Either way most of my VM based tests worked. A few minor tweaks such as putting apt into noninteractive. My copy of /etc in the end was a -R not a -Rf, this has been changed even for apt.

Notes Feb 22 2024

I spent all day testing this with VMs and found a problem that would prevent my code from running properly. Turns out if the system has no manually downloaded and installed packages, the line below causes awk to hang waiting for input.

apt list --installed | grep ',local]' | awk -F/ '{print $1}' >> $tmpdir/exclusions

Now I tried to use timeout and well that didn't work. After many hours I figured lets toss the line at chatgpt maybe it comes up with something I overlooked and it did. Simply check for output first, wow I was adding all the crazy debug code to all parts of this thing and overlooked that. It suggested a fix which wasn't elegant, but appears to work. Hopefully, this resolves a few issues. Next up maybe some tweaks to exclusions to speed the process up.

Notes Oct 29 2023

I've been at it adding a few tweaks here or there. Trying to add a good system for exclusions to make things more protable. While the current version works great on say VPS running the same base image, its not so good on different ones. This is due to some packages perhaps having different names like kernel images, modules and headers. This also includes things installed from a single package file you downloaded that isn't in a repo. Technically not bugs, but I want more flexibility.

Special Thanks

To the fine folks that created codeium(Link below). The autosuggest / autocomplete features make things allot easier and save me a ton of typing. Having an AI that can function as an assistant is a wonderful thing.

built with Codeium