воскресенье, 23 октября 2011 г.

How to simple create backup for all packages in FreeBSD

Create and go to the folder where you want create backup packages
# mkdir /BACKUP && cd /BACKUP

Create list file packages for next editing to our script
# ls -1 /var/db/pkg/ > list.sh

Edit list.sh
replace "\n" to " && pkg_create -v -b "
move last " && pkg_create -v -b " to begin file
remove first " && " from the begin
go to start line
insert "#!/usr/local/bin/bash"
create new line

Make file executable
chmod +x list.sh

Execute script
# ./list.sh

©by Kuzzya