Hi there,
I back up my system with the following commands (from a running dietpi-setup) remotely:
#some ops before the backup
sshpass -p $password ssh root@$ip "sudo dd if=/dev/mmcblk0 bs=1M status=progress | pigz -" | dd of=largebackup.gz
#some ops after the backup
pv largebackup.gz | pigz -d -c > Raspi.img
sudo pishrink.sh -a Raspi.img #https://github.com/Drewsif/PiShrink
pv Raspi.img | pigz -c > small_backup.gz
I am doing this for years now on original raspbian images with great success. But dietpi is better for my purpose then the original raspbian =)
The small_backup.gz is just about 1/5 of the size of large_backup.gz and I can do on-the-fly operations just before and just after a backup.
I am open for a better approach, but basically this is not my question.
The questions are:
-
I need to run certain commands (i.e.
systemctl enable dietpi-fs_partition_resize
) on the first boot of a backed up system only. How would I do this? -
If there is a way to “reset” a diet-pi system before backing it up as an image this would also be a great approach since the system would behave like on the VERY first boot of an original dietpi-image. How would I do this?
-
Is there a “how do I back up my dietpi-system” guide?
Thanks for your help!
LeFish