hmc
Active Member
Hi guys,
I'd like to write a bash script, which backs up my Pandora to an external hard drive, so that I can later restore the entire Pandora system from that backup easily.
After three times making a small mistake with some commands, resulting in either complete or partial destroyed root file systems ;-) (and since this is very annoying for me, because I apply a lot of modifications to the default system for optimization) I think it's time now to implement a good backup script.
What's already working is the rsync part, which incrementally backs up the FAT partition of my boot SD card.
Now I'd need a suitable tar command, which generates a tarball of the rootfs.
I'd like to have, as the result, a tarball which can be used in place of the pandora-rootfs.tar.bz2 file when generating a new bootable SD card.
What I currently do is
I suspect I need to tar the entire root fs, but is it a good way to simply to a
?
Won't there be problems with accessing the /dev/* nodes and other nasty things?
However, the original pandora-rootfs.tar.bz2 seems to contain those things ...
Thanks,
Daniel
I'd like to write a bash script, which backs up my Pandora to an external hard drive, so that I can later restore the entire Pandora system from that backup easily.
After three times making a small mistake with some commands, resulting in either complete or partial destroyed root file systems ;-) (and since this is very annoying for me, because I apply a lot of modifications to the default system for optimization) I think it's time now to implement a good backup script.
What's already working is the rsync part, which incrementally backs up the FAT partition of my boot SD card.
Now I'd need a suitable tar command, which generates a tarball of the rootfs.
I'd like to have, as the result, a tarball which can be used in place of the pandora-rootfs.tar.bz2 file when generating a new bootable SD card.
What I currently do is
Code:
tar cfjv "$DESTINATION"/SD_ROOT.tar.bz2 /etc /usr /bin /home /pandora /sbin /var /boot /lib 2>&1 | tee backup.log
I suspect I need to tar the entire root fs, but is it a good way to simply to a
Code:
tar cfjv "$DESTINATION"/pandora-rootfs-backup.tar.bz2 / 2>&1 | tee backup.log
?
Won't there be problems with accessing the /dev/* nodes and other nasty things?
However, the original pandora-rootfs.tar.bz2 seems to contain those things ...
Thanks,
Daniel