I try not to ask questions here which might reveal that I am complete imbecile, but what is the difference between a MySQL dump and the contents of /var/db/mysql? Previously I thought I was safe simply backing up that directory. My interaction with MySQL is mostly limited to using databases/phpMyAdmin to set up up DBs for apps like www/joomla25 and email/roundcube.xtaz said:This file contains a dump of my MySQL databases
There could be a changes in a database while you coping MySQL's database files(MySQL extensively using RAM to cache data and slowly synchronize it with files). It is dangerous to just copy files if MySQL are running, but if you stop it before coping then it is most fastest way to for backup. Use mysqldump if you won't shutdown temporally MySQL while doing backup, it is lock database tables and guarantee atomic operation.cbrace said:but what is the difference between a MySQL dump and the contents of /var/db/mysql?
cbrace said:Thanks for the helpful info.I try not to ask questions here which might reveal that I am complete imbecile, but what is the difference between a MySQL dump and the contents of /var/db/mysql? Previously I thought I was safe simply backing up that directory. My interaction with MySQL is mostly limited to using databases/phpMyAdmin to set up up DBs for apps like www/joomla25 and email/roundcube.
#!/bin/sh
#
# $FreeBSD
#
CONTENT_FILE="/hq/sysbk/archive_content"
EXCLUDE="/hq/sysbk/exclude_content"
CUR_FILENAME="$(hostname -s)-`date +'%Y%m%d'.tar`"
# /* we are using append option in tar, make sure that .tar with this name does not exist */
if [ -f ${CUR_FILENAME} ] ; then
printf "removing old backup - $CUR_FILENAME\n"
rm ${CUR_FILENAME}
fi
for item in `grep -vE '^$|^#' $CONTENT_FILE`; do
tar -vpr --check-links -X $EXCLUDE -f ${CUR_FILENAME} $item
done
/root/
/usr/home/
/usr/home/martin/portal/
What is the best way to backup a listing of ports installed? Ideally in the form of a file one can use to reinstall all ports in at one go. I already make a back up of /var/db/pkg, so I don't have to go through all the settings again.xtaz said:This file contains a dump of my MySQL databases, my kernel config file, /boot/loader.conf, copies of my crontabs, a list of which ports are installed
Sounds like a great idea, but it appears to be still in the realm of wishful thinking. FWIW, there is a very simple utility included in Linux Mint, which I have installed on my Asus netbook, which allows you to save a list of all the packages you have installed. After doing a clean reinstall you can then load the file and install all the .deb packages again. Is there anything comparable for FreeBSD?TODO
Add portsbackup and portsrestore utilites. They will save ports data (/etc/make.conf, /var/db/pkg, /var/db/ports, /usr/local/etc) and restore all ports on another computer by rebuilding them from the ports tree.
joesmoe said:Maybe pkg_info > some-file
In order to catelog all your currently installed stuff. Not sure how you'd safe all the config options though.
cbrace said:What is the best way to backup a listing of ports installed? Ideally in the form of a file one can use to reinstall all ports in at one go. I already make a back up of /var/db/pkg, so I don't have to go through all the settings again.
portmaster --list-origins > ports-list
portmaster `cat ports-list`
$ cat ports-list | grep php53
ftp/php53-curl
graphics/php53-exif
sysutils/php53-fileinfo
$ ls -d1 /var/db/pkg/php53*
/var/db/pkg/php53-5.3.17
/var/db/pkg/php53-bz2-5.3.17
/var/db/pkg/php53-ctype-5.3.17
/var/db/pkg/php53-curl-5.3.17
/var/db/pkg/php53-dom-5.3.17
/var/db/pkg/php53-exif-5.3.17
/var/db/pkg/php53-fileinfo-5.3.17
/var/db/pkg/php53-filter-5.3.17
/var/db/pkg/php53-gd-5.3.17
/var/db/pkg/php53-gettext-5.3.17
/var/db/pkg/php53-hash-5.3.17
/var/db/pkg/php53-iconv-5.3.17
/var/db/pkg/php53-json-5.3.17
/var/db/pkg/php53-ldap-5.3.17
/var/db/pkg/php53-mbstring-5.3.17
/var/db/pkg/php53-mcrypt-5.3.17
/var/db/pkg/php53-mysql-5.3.17
/var/db/pkg/php53-mysqli-5.3.17
/var/db/pkg/php53-openssl-5.3.17
/var/db/pkg/php53-session-5.3.17
/var/db/pkg/php53-simplexml-5.3.17
/var/db/pkg/php53-xml-5.3.17
/var/db/pkg/php53-zip-5.3.17
/var/db/pkg/php53-zlib-5.3.17
Packages don't have settings. The only thing you backed up is a list of installed ports/packages. If you built from ports the settings you're looking for are in /var/db/ports/.cbrace said:I already make a back up of /var/db/pkg, so I don't have to go through all the settings again.