wilsonsamm Apprentice
Joined: 12 Jul 2008 Posts: 196
|
Posted: Tue Mar 17, 2015 2:00 pm Post subject: Backing up OS with Rsync |
|
|
I often use Rsync to back my home partition up on an NFS share or removable media. I thought to myself, why not use it to copy my gentoo from my main work computer to my laptop! It will probably run a bit smoother on my laptop than Linux Mint, with a little configuration. So I wrote a simple script:
Code: | #!/bin/bash
rsync -avx --delete / \
--exclude=/usr/portage/ \
--exclude=/usr/include/ \
--exclude=/usr/src/ \
--exclude=/var/log/ \
/mnt/share/gentoo
|
/mnt/share/ is network storage. As you can see, I have a directory there, and I intend to copy my entire operating system there, (excluding a few directories not necessary for day-to-day operation).
Then I can simply boot my laptop into linux mint, and then use rsync to copy gentoo onto the laptop.
Code: | #!/bin/bash
rsync -avx /mnt/share/gentoo /mnt/gentoo
update-grub2 |
(remember, because this might copy a new kernel over, we also need to run update-grub2 to get grub to have a look. |
|