Well, after some experimentation, it appears that the below set of commands does a pretty good job of backing up all of my user settings and all of my packages into a backup folder. The below is part of a script file I have been using for the past few months with reasonable success. I didn't want to bog everyone down with the entire contents of my backup script file, so I just included the below lines.
Also, I have managed to coddle together the below command which will give me three different list of packages on my system. The first command creates a list of all packages, and then the second command creates a list of packages installed during the basic installation of FreeBSD, while the third command below creates a list of third party only packages, which are not part of the initial installation process.
Now, the problem that I have is that the pkg create command from my above backup script file backs up all of the packages on my system to, /diskbkp/backup/var/cache/pkg. This isn't really a major problem, but if I have to do a complete reinstall, and then I use the below command contained within my restore script file, then I notice that the below command seems to waste a lot of time trying to reinstall packages which have already been during the basic reinstallation of the operating system itself.
So I guess that my question then becomes, is there anyway possible to modify the package add command directly above, so that it only adds packages contained within the list, /diskbkp/backup/third_party_only.txt, and it ignores everything else? I tried replacing the star with a path pointing to the third party only text file, but that didn't seem to work. Any advice greatly appreciated.
Code:
mkdir -p /diskbkp/backup/boot
mkdir -p /diskbkp/backup/usr/local
mkdir -p /diskbkp/backup/home
mkdir -p /diskbkp/backup/etc
mkdir -p /diskbkp/backup/var/cache/pkg
rsync -avhpoHX --progress /boot/loader.conf /diskbkp/backup/boot/loader.conf
rsync -avhpoHX --progress /usr/local/etc/ /diskbkp/backup/usr/local/etc/
rsync -avhpoHX --progress /home/ /diskbkp/backup/home/
rsync -avhpoHX --progress /etc/ /diskbkp/backup/etc/
pkg create -a -o /diskbkp/backup/var/cache/pkg
Also, I have managed to coddle together the below command which will give me three different list of packages on my system. The first command creates a list of all packages, and then the second command creates a list of packages installed during the basic installation of FreeBSD, while the third command below creates a list of third party only packages, which are not part of the initial installation process.
Code:
pkg info > /diskbkp/backup/packagelistv.txt
grep "^FreeBSD-" /diskbkp/backup/packagelistv.txt > /diskbkp/backup/base_os_only.txt
grep -v "^FreeBSD-" /diskbkp/backup/packagelistv.txt > /diskbkp/backup/third_party_only.txt
Now, the problem that I have is that the pkg create command from my above backup script file backs up all of the packages on my system to, /diskbkp/backup/var/cache/pkg. This isn't really a major problem, but if I have to do a complete reinstall, and then I use the below command contained within my restore script file, then I notice that the below command seems to waste a lot of time trying to reinstall packages which have already been during the basic reinstallation of the operating system itself.
Code:
pkg add /diskbkp/backup/var/cache/pkg/*
So I guess that my question then becomes, is there anyway possible to modify the package add command directly above, so that it only adds packages contained within the list, /diskbkp/backup/third_party_only.txt, and it ignores everything else? I tried replacing the star with a path pointing to the third party only text file, but that didn't seem to work. Any advice greatly appreciated.