Hello, I’m the maintainer of shrink-backup. I saw incoming links for endeavouros forum and it made me curious what was being said about it.
Yes, sadly he passed away a while ago, but the project is still maintained by me (twin brother). He left a LOT of notes, documentation, and all of his keys and logins so I have full control and access to all his accounts. It has taken me a while to go through all of the notes.
Fun fact: the idiot actually used an image of ME on his github, so I didn’t have to change anything when taking over his account… 
But for you Fredde, you are actually mentioned pretty fondly in it. Might be nice to know. 
Example quote: “linux-aahus is a nice bearded dude from Denmark that has been very helpful on the Manjaro forum”
Moving on from that.
shrink-backup IS maintained, updates are just not as rapid as previously. Mostly if bugs are discovered or if requests for specific distros are made to make sure autoexpansion works as it should.
gpt partition table is for example something in the works to fix, there is a branch that works for gpt that can be used, but I haven’t felt any rush to push it for a new release since I think it is a very small portion of users that actually use gpt for single board computers.
Clone the repo and `git checkout gpt` if you actually use a gpt partition table and it should work.
I also saw someone ask where to place the script.
As @Root mentioned, it works from anywhere, but if you want to aCsHuAlLy be “correct”, it should go into /usr/local/sbin/shrink-backup, then there is no need to edit $PATH since that directory is already in your $PATH.
There is also an alternative installation method that can be used that places everything like it’s a package installed on the system, although I am not a huge fan of running curl into bash, but users requested it so it was created: curl https://raw.githubusercontent.com/UnconnectedBedna/shrink-backup/install/installer.sh | sudo bash
More info can be found here: https://github.com/UnconnectedBedna/shrink-backup/wiki/Installing#curl---shrink-backup-install-script
I would also like to add that running shrink-backup over network should not be an issue since rsync is used in the copy process, so crc checks are made automatically. (I run all my backups to an NFS mount)
So, the github repo is monitored and both issues and questions posted in the discussion section of the github repo will be addressed.
There is also a helper script that can be created (can be found in one of the questions about compression on the discussion section of the github repo), it’s “on-the-list-of-things-to-be-added-to-the-wiki” soon™. xD
It includes compression for those who want that “on the go” and mounts/unmounts backup location. You need to edit the script to fit your setup though (primarily mount location/method, APP & IMG_FILE variables). Name it for example backup.sh, make it executable and run it with one of the options available in the case statement. (or edit/add your own options)
#!/usr/bin/env bash
# This whole function can be removed/commented out if you do not mount the backup location using this script
# This function ensures the backup locations is unmounted if you press n (in script confirmation) or ctrl+c during the script
# Make sure path is correct to where your mount is located
# The space after the path is intentional, ie NOT: '/mnt/backup', but rather: '/mnt/backup ' is REQUIRED
function cleanup() {
if grep -qs '/mnt/backup ' /proc/mounts; then
echo '## Unmounting backup mount'
umount /mnt/backup
fi
}
trap cleanup EXIT SIGTERM SIGINT
# Check if script is running as root
if [ "$EUID" -ne 0 ]; then
echo '!! THIS SCRIPT MUST BE RUNNING AS ROOT! (WITH SUDO)'
exit 1
fi
# If you want the script to mount the backup location, NFS (192.168.1.100 at /mnt/backup) in this example.
# Change to the method you mount or comment out/remove if not wanted
echo '## Mounting backup location'
mount -t nfs 192.168.1.100:/foo/bar /mnt/backup
sleep 1
# Check if the backup location is mounted, comment out/remove if not wanted
# Make sure path is correct to where your mount is located
# The space after the path is intentional, ie NOT: '/mnt/backup', but rather: '/mnt/backup ' is REQUIRED
if ! grep -qs '/mnt/backup ' /proc/mounts; then
echo 'ERROR! Backup location not mounted!'
exit 1
fi
APP='/path/to/shrink-backup'
IMG_FILE='/mnt/backup/backup.img'
# Options
case "$1" in
-a) "$APP" -Utlaz "$IMG_FILE";;
-N) if [ -n "$2" ]; then
"$APP" -tlz "$IMG_FILE" "$2"
else
"$APP" -atlz "$IMG_FILE"
fi
chown 1000:1000 "$IMG_FILE"
;;
--loop) "$APP" -lz --loop "$IMG_FILE";;
--fix) "$APP" -Utl --fix "$IMG_FILE" "$2";;
--chroot) "$APP" -lz --chroot "$IMG_FILE";;
*) "$APP" -Utlz "$IMG_FILE" "$1";;
esac
sleep 1
# Add compression here, change to compression method of your choice by editing the `tar` line
echo '## Compressing backup img'
tar -czvf /mnt/backup/backup.tar.gz "$IMG_FILE"
sleep 1
# Removing img file after compression is done
# If you update the img file, maybe you don't want this
# Or maybe you want to add a decompression of the tar.gz file at the start of this script
rm /mnt/backup/backup.img
exit 0
Make sure the script is executable with chmod u+x /path/to/backup.sh
And then run it with the option you prefer:
-N = New backup, (-atlz options)
(optional to set desired extra space here
for example: ./backup.sh -N 1024)
-a = Update backup and autoresize if needed (-Utlaz options)
--loop = loop img file
--fix = Update backup and fix "broken pipe" errors (-Utl --fix options)
Example: sudo /path/to/backup.sh -N will create a new backup at /mnt/backup/backup.img and then compress it into /mnt/backup/backup.tar.gz and finally remove the img file.
Running without any options, ie: sudo /path/to/backup.sh will result in an image update with zoom speed activated (* = -Utlz options)
For detailed information about the script, read the README.md or visit the repo on github.
I sincerely hope you find shrink-backup to your liking.