A reliable backup strategy for a newbie

Well, I'm the sort of newbie who seems to enjoy breaking his own installation of FreeBSD, and then spending the next few hours making it work again. While I've learned a few things from doing this over and over, I've decided that it's now a good time to come up with reliable strategy for recovering from my own mistakes, that way I can hopefully spend my time learning more productive things with FreeBSD.

At anyrate, I came across the below thread, which seems to provide a backup scenario which someone at my skill level should be able to handle. Also, I've read about using mksnap_ffs to create snapshots, but the process of using the snapshots to recover missing or corrupted data seems a little bit murky to me at this point, so I'm leaning towards the method outlined in the below link.


However, there is something I don't understand about the below set of commands, which I've copied and pasted from the above thread.

Code:
mkdir -p /backup/boot
mkdir -p /backup/usr/local
rsync -a /boot/loader.conf /backup/boot
rsync -a /etc /backup
rsync -a /usr/local/etc /backup/usr/local
rsync -a /usr/home /backup/usr

It appears that the above set of commands will create back up directories for /boot and /usr, but how come there does not appear to be a command listed to create a back up directory for /etc? Also, would the above commands referencing /usr automatically create a back of the files located under /usr/local/etc/X11/xorg.conf.d/nvidia-conf?
 
If you just want to guard against fatfingering something then the easiest is to install on ZFS and pick one of the automatic snapshot makers from ports.

Learning rsync will pay off for you. It can be intimidating reading the manpage, though. But most options you don't need.
 
If you just want to guard against fatfingering something then the easiest is to install on ZFS and pick one of the automatic snapshot makers from ports.

Learning rsync will pay off for you. It can be intimidating reading the manpage, though. But most options you don't need.
I regred not picking ZFS during the installation process, and I now realize that I've kind of painted myself into a corner by going with UFS. I will probably try installing FreeBSD using ZFS on another old hard drive I have sitting on the shelf, and see how that works out. I know that this may sound foolish, but I feel that I have something invested into my current installation using UFS, and even though I picked the wrong file system, I feel like that I want to learn as much as I can from it. Maybe I'm wrong, maybe I should scrap it and move onto ZFS, but I will try UFS a while longer.
 
I regred not picking ZFS during the installation process, and I now realize that I've kind of painted myself into a corner by going with UFS. I will probably try installing FreeBSD using ZFS on another old hard drive I have sitting on the shelf, and see how that works out. I know that this may sound foolish, but I feel that I have something invested into my current installation using UFS, and even though I picked the wrong file system, I feel like that I want to learn as much as I can from it. Maybe I'm wrong, maybe I should scrap it and move onto ZFS, but I will try UFS a while longer.

It's not foolish at all to stick to some installation and make it do what you want. It is how you learn. Nothing is learned from constantly reinstalling on the first difficulty.

Learn rsync is my recommendation.
 
UFS is definitely not a "bad" option so there's nothing "wrong" in sticking with it for now. It's worth looking at ZFS, definitely, but the world isn't going to end because you are using UFS.

And +1 to rsync.

Your questions above - the rsync of the etc directory will create the sub-directory in backup - so you'll end up with /backup/etc. Just like it doesn't create /backup/usr/local/etc - the commands create /backup/usr/local, and the rsync will make /backup/usr/local/etc. And yes, rsync with the -a flag is recursive, so it will walk directories.

Just give it a whirl, especially if this is a test system and you are just learning.
 
I'm nowhere near a power user or a server admin, I just use FreeBSD on a desktop computer at home. My setup consists of zfs mirror of both / and /home, so I have 4 physical disks and one external disk, which receives automatic backups, with daily, weekly, monthly snapshots. I am using syncoid via my own backup script and zfs-auto-snapshot functionality via cron to achieve that.
I don't remember who is the original author of that solution, definitely not me though, so if you want any additional info, I will try to answer.
 
Frankly, without zfs and its boot environments, any upgrade would be hell for me. You never know what is going to break, even if you can predict some and take suited countermeasures.

It is the same when I break myself the system by ignorance. When I can't repair, I return to the last boot environment.
 
Back
Top