Frequently Asked Questions about usage of Synbak
Last Update: 20061014


Architecture
============
Q: I like synbak and i want it translated to my language, but i don't know where begin!
A: Synbak use the standard GNU gettext localization system
   translating synbak is very simple, use the following steps:

   1) download synbak tar.gz source package
   2) tar zxvf synbak-x.x.x.tar.gz
   3) cd synbak-x.x.x/po
   4) cp synbak.pot to language.po (example: use 'de.po' for Deutsche language)
   5) translate to your language all (msgstr "") lines and send it to opensource@initzero.it. it will be included in the next synbak release

   Many thanks for supporting synbak


Q: How works the 'backup_exclude' directive, and how can i exclude directory paths with spaces?
A: The backup_exclude directive need direcory paths or regexp patterns.
   for examples:
   backup_exclude = *.ldb /tmp /proc /sys /some/path/to/exclude

   If you want exclude directories with spaces in the name, you can use the escape key "\", for example:

   backup_exclude = /Documents\ and\ Settings/UserName /a\ path\ with\ spaces/direcory/subdirectory/another\ directory/



Methods
============
Q: How can i see what methods are supported by synbak?
A: Run synbak with:

   > synbak -s system -m something

   Of course, something can be anything :-)


Q: I want to backup a remote machine, what method can i use?
A: The suggested method to backup remote machine files is 'rsync'
   just comment out the 'backup_remote_uri' and 'report_remote_uri_down' variables
   and use a valid URI pointing to the remote machine.
   synbak remote rsync method born to supply an universal way to backup files to a local directory, supporting many way to make that.
   for example:

   ## rsync via rsync daemon
   1) assume that remote host name or ip address is: 192.168.0.1
   2) in the remote machine is running a plain rsync daemon (port 873 open)
   3) the remote rsync share is named: backup
   4) you are able to connect to remote rsync daemon from your synbak server
   
   in your synbak system config file you must put:
   backup_remote_uri = rsync://192.168.0.1/backup

   ## rsync via ssh daemon (useful to make secure backup via untrusted network like internet)
   1) assume that remote host name or ip address is: www.example.com
   2) if you want backup all remote system files you must use the root account
   3) your synbak server public ssh certificate is installed in the target machine (/root/.ssh/authorized_keys)
   4) the ssh daemon is running in the standard ssh port (TCP-22)

   in your synbak system config file you must put:
   backup_remote_uri = ssh://root@www.example.com

   if your remote ssh server is running in another port (not the default 22) like port 22622, you can simply use:
   backup_remote_uri = ssh://root@www.example.com:22622

   ## rsync of a Windows machine (NetBios protocol = smb or cifs) having a standard windows share enabled
   1) assume that remote host name or ip address is: intranetserver
   2) the remote share is named backup$
   3) the remote machine and the local synbak server support cifs protocol (samba >= 3.x and kernel >= 2.6.x)
   
   in your synbak system config file you must put:
   backup_remote_uri = cifs://Administrator:password@intranetserver/backup$

   if your synbak server doesn't support cifs (aka mount.cifs command), you can use smb protocol:
   backup_remote_uri = smb://Administrator:password@intranetserver/backup$

   NB. If you want mantain remote file ownership YOU MUST RUN SYNBAK FROM 'root' ACCOUNT


Q: I just use synbak rsync method to make my server's data secure, but, some server are running live databases like MySQL, Oracle o LDAP directories
   how can i make a safe and clean database dumps using synbak?
A: comment out 'backup_remote_uri' and 'report_remote_uri_down' and use a URI like these:

   # For MySQL dumps
   backup_remote_uri = mysql://username:password@hostname

   # For Oracle dumps
   backup_remote_uri = oracle://username:password@SID

   # For LDAP dumps
   backup_remote_uri = ldap://cn=Manager:password@hostname

   if the remote daemons are not running in the default port, you can specify that like other URI:
   backup_remote_uri = mysql://username:password@hostname:3307

   For the MySQL method exist a special syntax that allow you to make a single database dump for each database found (useful for easy single database recovery)
   This is valid if you are running synbak from the database machine itself.

   For example if the databases are installed in /var/lib/mysql:
   backup_remote_uri = mysql://username:password@localhost/var/lib/mysql


Q: How can i know if a backup method needs some extra options?
A: Run synbak with:

   > synbak -s system -m tar -M something

   the output will be:

   ERROR: The specified extra option 'something' is invalid, follow a list of usable extra options: tar, gz, bz2


Q: What devices are supported by tape method?
A: All devices supported by your Linux machine :-)
   you can verify the tape device name with following command:

   $ dmesg | grep ^st

   For example my output is:

   st: Version 20050830, fixed bufsize 32768, s/g segs 256
   st 5:0:5:0: Attached scsi tape st0
   st0: try direct i/o: yes (alignment 512 B)
   st0: Block limits 1 - 16777215 bytes

   now, you can configure a tape method using '/dev/st0' device as backup_destination:

   backup_destination = /dev/st0


Q: How can use a multi loader tape?
A: Firts you must discover your tape loader scsi device address name (generally /dev/sgX, where X is a number)
   then you must comment out the following line:
   backup_device_changer = /dev/sdg1

   and run a tape backup supplyng the extra options:

   synbak -s myserver -m tape -M 1

   where 1 is the first tape number loaded in the tape changer


Q: How can i use synbak automatically without human presence?
A: Unix crontab is your best friend :-)

   launch from command prompt: crontab -e 

   a synbak crontab example:

   00 00 * * *   synbak -s dserver         -m ldap

   10 00 * * *   synbak -s dbserver1       -m oracle

   15 00 * * *   synbak -s dbserver2       -m mysql
   30 00 * * *   synbak -s dbserver3       -m mysql
   45 00 * * *   synbak -s dbserver4       -m mysql

   45 00 * * *   synbak -s fileserver1     -m rsync
   30 01 * * *   synbak -s fileserver2     -m rsync
   00 02 * * *   synbak -s webserver       -m rsync
   00 03 * * *   synbak -s erpserver       -m rsync
   00 04 * * *   synbak -s hostingserver   -m rsync
   00 05 * * *   synbak -s firewall        -m rsync

   00 06 * * 2   synbak -s servers         -m tape -M 1
   00 06 * * 3   synbak -s servers         -m tape -M 2
   00 06 * * 4   synbak -s servers         -m tape -M 3
   00 06 * * 5   synbak -s servers         -m tape -M 4
   00 06 * * 6   synbak -s servers         -m tape -M 5

   00 11 * * 1-5 synbak -s customerserver  -m rsync
   23 */4 * * *  synbak -s laptop          -m rsync



Reports
============
Q: How can i totally rebuild my html indexes (all days, months and years)?
A: Normally when you run synbak, it update the current day only, but, if you need it,
   you can rebuild your html indexes and directory tree adding the '-r html -R ria' options to your backup job.
   example:
   if your system is named 'webserver' and your method is 'ldap', you must launch synbak with the following command:

   > synbak -s webserver -m ldap -r html -R ria

   you should see the following output:

   Rebuilding indexes:  Generating report: 'html' Duration:[00:19:23] Status:[OK]

   now if you go to your synbak web reports interface you will see all indexes updated


