You need to be Payday Loans UK Why would you

Backup freebsd howto with fsbackup

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 && make install clean

this is create directory /usr/local/fsbackup/ with scripts and config files

2.Let’is go to explore scripts and configs:

cache/ - directory for temporary hash
cfg_example - config example a good described and should be intuitive understandable. Follow I give my working config.
create_backup.sh – script running backup. You have to add it in /etc/crontab for automatically backup.
fsbackup.pl – it is a general sript of fsbackup
scripts/fsrestore.sh – restore you data
scripts/mysql_backup.sh – create backup MySQL database
scripts/pgsql_backup.sh – create backup PostgreSQL database
scripts/sqlite_backup.sh – create backup SQLLite database
scripts/sysbackup.sh – store system configuration files and information about installed packages
scripts/sysrestore.sh – reinstall packages stored by sysbackup.sh

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 “1″):

backup_mysql=1
backup_pgsql=0
backup_sqlite=0
backup_sys=1

Don’t forget put in this scripts your data. For example for properly storing mysql you have to fill your data such as:
backup_mysqluser="backuper"
backup_mysqlpassword="54dD1f6y7wfM959fM"
backup_path="/backup/mysql"

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:
Create two different config files by analogy with cfg_example (mail.conf and www.conf) and define it in start scripts directory: config_files=”mail.conf www.conf” -> create_backup.sh

4.This is promised my working config that store virtual mail folders:

$cfg_backup_name = "howtobsd_mail";
$cfg_cache_dir = "/usr/local/fsbackup/cache";
$prog_md5sum = "md5sum -b";
$prog_tar = "/usr/bin/tar";
$prog_ssh = "/usr/local/bin/ssh -i /usr/local/fsbackup/backup.prv";
$prog_rm = "/bin/rm";
$prog_gzip = "/usr/bin/gzip";
$cfg_checksum = "timesize";
$cfg_backup_style = "backup";
$cfg_increment_level = 16;
$cfg_save_old_backup = 1;
#$cfg_type = "remote_ftp";
$cfg_type = "local";
$cfg_remote_host="x.x.x.x";
$cfg_remote_password="backuper";
$cfg_remote_login="backuper";
$cfg_remote_path="/storage/backup/mail";
$cfg_local_path = "/backup/mail";
$cfg_time_limit = 0;
$cfg_size_limit = 100000;
$cfg_maximum_archive_size = 0;
$cfg_root_path = "/";
$cfg_stopdir_prune=0;
$cfg_verbose = 2;
__DATA__
/usr/local/fsbackup
f!\.core$
f!^core$
f!\.o$
f!\.log$
d!\.snap
# Users
f!.*\.avi$
f!.*\.mpeg$
f!.*\.mpg$
f!.*\.mp3$
#logs
f!/var/log/.*\.1\.bz2
f!/var/log/.*\.2\.bz2
f!/var/log/.*\.3\.bz2
f!/var/log/.*\.4\.bz2
f!/var/log/.*\.5\.bz2
f!/var/log/.*\.6\.bz2
f!/var/log/.*\.7\.bz2
f!/var/log/.*\.8\.bz2
f!/var/log/.*\.9\.bz2
f!restoresymtable
#importennt!
/var/mail/virtual

This config describe local type. I prefer use ncftp for uploading backups to remote server.
I use “backup style” (increment) with cfg_increment_level = 16 – it’s mean that every 16 backup will be full (other only incremental). So, approximate twice on the month it do a full backup.

5.If you want use ftp remote backup type change this strings:

$cfg_type = "remote_ftp";
$cfg_remote_host = "ftp.server.com";
$cfg_remote_login = "ftpuser";
$cfg_remote_path = "tmp";
$cfg_remote_password = "ftppassword";

Check rights on the remote folder.
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 – use pgp encryption or vpn :) .

6. Finally, when you have finished configure add running start script to /etc/crontab:
10 1 * * * root /usr/local/fsbackup/create_backup.sh | mail -s "howtobsd backup report" root
Storing starting at 1:10 and sends reports to mail.

Comments are closed.