I realise this is not the same as backing up a configuration, but it may
be useful as a way to backup your entire SD card - I do a nightly
backup of the SD card with this script:
Code:
--------------------
imagefile=$1
bs=$(fdisk -l | grep -A 3 mmcblk0: | grep Units: | awk -F= {'print $2'} | awk
{'print $1'})
echo "blocksize="$bs
count=$(fdisk -l | grep mmcblk0p2 | awk {'print $5+1'})
echo "count="$count
dd if=/dev/mmcblk0 bs=$bs count=$count | gzip > $imagefile
# dd if=/dev/mmcblk0 bs=512 count=2170880 | gzip >
/mnt/Music/DiskImages/pCPLounge.img.gz
--------------------
which I call with:
Code:
--------------------
/home/tc/BackupSD.sh /mnt/Music/DiskImages/pCPLoungePi4.img.gz
--------------------
I run this at 2am every day via a CRON job:
Code:
--------------------
0 2 * * * /home/tc/NightlyJobs.sh
--------------------
I then backup (and occasionally archive) my /mnt/Music/DiskImages
folder. I can then write the disk image (pCPLounge.img.gz) back to an
SD card (again using DD) if something goes wrong with the main SD card -
it's got me out of trouble a couple of times.
------------------------------------------------------------------------
chill's Profile: http://forums.slimdevices.com/member.php?userid=10839
View this thread: http://forums.slimdevices.com/showthread.php?t=110727
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix