<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HowToBSD &#187; fsbackup</title>
	<atom:link href="http://howtobsd.com/tag/fsbackup/feed" rel="self" type="application/rss+xml" />
	<link>http://howtobsd.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 11 Feb 2014 11:21:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Backup freebsd howto with fsbackup</title>
		<link>http://howtobsd.com/software/howto-create-backup-on-freebsd-with-fsbackup.html</link>
		<comments>http://howtobsd.com/software/howto-create-backup-on-freebsd-with-fsbackup.html#comments</comments>
		<pubDate>Tue, 01 Jun 2010 15:12:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[fsbackup]]></category>

		<guid isPermaLink="false">http://howtobsd.com/?p=123</guid>
		<description><![CDATA[Fsbackup is a good and simple freebsd backup software for backuping your information. When you finish read this article you will be able to backup on freebsd your data automatically on the local directory or remote ftp server. 1.First of all we are going to install port fsbackup: #cd /usr/ports/sysutils/fsbackup &#038;&#038; make install clean this [...]]]></description>
				<content:encoded><![CDATA[<p>Fsbackup is a good and simple freebsd backup software for backuping your information.<br />
When you finish read this article you will be able to backup on freebsd your data automatically on the local directory or remote ftp server.</p>
<p>1.First of all we are going to install port fsbackup:</p>
<p><code>#cd /usr/ports/sysutils/fsbackup  &#038;&#038; make install clean</code></p>
<p>this is create directory <strong>/usr/local/fsbackup/</strong> with scripts and config files</p>
<p>2.Let&#8217;is go to explore scripts and configs:</p>
<p><strong>cache/ </strong>- directory for temporary hash<br />
<strong>cfg_example </strong>- config example a good described and should be intuitive understandable. Follow I give my working config.<br />
<strong>create_backup.sh</strong> &#8211; script running backup. You have to add it in /etc/crontab for automatically backup.<br />
<strong>fsbackup.pl</strong> &#8211; it is a general sript of fsbackup<br />
<strong>scripts/fsrestore.sh</strong> &#8211;  restore you data<br />
<strong>scripts/mysql_backup.sh</strong> &#8211; create backup MySQL database<br />
<strong>scripts/pgsql_backup.sh</strong> &#8211; create backup PostgreSQL database<br />
<strong>scripts/sqlite_backup.sh</strong> &#8211; create backup SQLLite database<br />
<strong>scripts/sysbackup.sh</strong> &#8211; store system configuration files and information about installed packages<br />
<strong>scripts/sysrestore.sh</strong> &#8211;  reinstall packages stored by sysbackup.sh</p>
<p>If you want use any from this scripts (for example mysql_backup.sh and sysbackup.sh), you have to define it in the create_backup.sh start script (put &#8220;1&#8243;): </p>
<p><code>backup_mysql=1<br />
backup_pgsql=0<br />
backup_sqlite=0<br />
backup_sys=1 </code></p>
<p>Don&#8217;t forget put in this scripts your data. For example for properly storing mysql you have to fill your data such as:<br />
<code>backup_mysqluser="backuper"<br />
backup_mysqlpassword="54dD1f6y7wfM959fM"<br />
backup_path="/backup/mysql"</code></p>
<p>3.You also can separate your backups. For example your need to store mail in the one place (ftp-server or directory) while www-dir in the other:<br />
Create two different config files by analogy with cfg_example (mail.conf and www.conf) and define it in start scripts directory: config_files=&#8221;mail.conf www.conf&#8221; -> create_backup.sh</p>
<p>4.This is promised my working config that store virtual mail folders:<br />
<code><br />
$cfg_backup_name = "howtobsd_mail";<br />
$cfg_cache_dir = "/usr/local/fsbackup/cache";<br />
$prog_md5sum    = "md5sum -b";<br />
$prog_tar       = "/usr/bin/tar";<br />
$prog_ssh       = "/usr/local/bin/ssh -i /usr/local/fsbackup/backup.prv";<br />
$prog_rm        = "/bin/rm";<br />
$prog_gzip      = "/usr/bin/gzip";<br />
$cfg_checksum = "timesize";<br />
$cfg_backup_style = "backup";<br />
$cfg_increment_level = 16;<br />
$cfg_save_old_backup = 1;<br />
#$cfg_type = "remote_ftp";<br />
$cfg_type = "local";<br />
$cfg_remote_host="x.x.x.x";<br />
$cfg_remote_password="backuper";<br />
$cfg_remote_login="backuper";<br />
$cfg_remote_path="/storage/backup/mail";<br />
$cfg_local_path = "/backup/mail";<br />
$cfg_time_limit = 0;<br />
$cfg_size_limit = 100000;<br />
$cfg_maximum_archive_size = 0;<br />
$cfg_root_path = "/";<br />
$cfg_stopdir_prune=0;<br />
$cfg_verbose = 2;<br />
__DATA__<br />
/usr/local/fsbackup<br />
f!\.core$<br />
f!^core$<br />
f!\.o$<br />
f!\.log$<br />
d!\.snap<br />
# Users<br />
f!.*\.avi$<br />
f!.*\.mpeg$<br />
f!.*\.mpg$<br />
f!.*\.mp3$<br />
#logs<br />
f!/var/log/.*\.1\.bz2<br />
f!/var/log/.*\.2\.bz2<br />
f!/var/log/.*\.3\.bz2<br />
f!/var/log/.*\.4\.bz2<br />
f!/var/log/.*\.5\.bz2<br />
f!/var/log/.*\.6\.bz2<br />
f!/var/log/.*\.7\.bz2<br />
f!/var/log/.*\.8\.bz2<br />
f!/var/log/.*\.9\.bz2<br />
f!restoresymtable<br />
#importennt!<br />
/var/mail/virtual</code></p>
<p>This config describe local type. I prefer use <a href="http://howtobsd.com/?p=132">ncftp</a> for uploading backups to remote server.<br />
I use &#8220;backup style&#8221; (increment) with cfg_increment_level = 16 &#8211; it&#8217;s mean that every 16 backup will be full (other only incremental). So, approximate twice on the month it do a full backup.</p>
<p>5.If you want use ftp remote backup type change this strings:</p>
<p><code>$cfg_type = "remote_ftp";<br />
$cfg_remote_host = "ftp.server.com";<br />
$cfg_remote_login = "ftpuser";<br />
$cfg_remote_path = "tmp";<br />
$cfg_remote_password = "ftppassword";</code></p>
<p>Check rights on the remote folder.<br />
Security. If it possible deny port 21 for all exept your servers IP. If you are paranoiac or level security for your data is so high &#8211; use pgp encryption or vpn <img src='http://howtobsd.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . </p>
<p>6. Finally, when you have finished configure add running start script to /etc/crontab:<br />
<code>10      1       *       *       *       root    /usr/local/fsbackup/create_backup.sh | mail -s "howtobsd backup report" root</code><br />
Storing starting at 1:10 and sends reports to mail.</p>
]]></content:encoded>
			<wfw:commentRss>http://howtobsd.com/software/howto-create-backup-on-freebsd-with-fsbackup.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
