MKSBackup overview
MKSBackup is a free
front-end for common backup tools like MS Windows ntbackup, and it successor wbadmin, Un*x tools like tar,
but also popular ghettoVCB to backup Virtual Machine on VMware ESX(i) host.
MKSBackup is developed in Python and is available for Microsoft Windows,
Linux and other Un*x systems.
MKSBackup is driven by a Command line interface
and jobs are defined in an INI file.
Its main feature is to send an email report including log files and all hints
that could help the user to estimate the real status of the backup.
Installation
Windows binaries and sources are available from the download page.
Windows
The Windows version is available as a executable and don't require the installation of Python.
It as been tested on Windows 2000, Windows XP, Windows 2003 and Windows 2008 R2, and should work on
all Windows systems posterior to Windows 2000.
You need to have the Microsoft Visual C++ 2008 Redistributable Package installed on your computer or you will have an error like this one:
Generate Activation Context failed for Reference error message: The referenced assembly is not installed on your system
The vcredist_x86.exe is freely available on the Microsoft web site here. Even if you run a 64bits OS, you need to install this 32bits version because the MKSBackup executable is 32bits.
Download the binary ZIP file and extract it in C:\magik\mkbackup or in any other directory.
Even on windows you can run MKSBackup from the sources. This require the installation of Python for windows. Version 2.6 is recommended. For more detail read the Un*x section below.
Linux and other Un*x
On Un*x system, you can download the sources and extract the files into /usr/local/mkbackup for example. At least python 2.4 is required and if you want to use the ghettovcb front-end, you need to install paramiko and pycrypto to manage the SSH protocol.
The tar front-end is made to use the GNU version of tar and find utilities.
The configuration file
The configuration file is a INI file. Here is a sample.
[DEFAULT]
smtp_host=smtp.myprovider.com
smtp_port=25
sender=backup.operator@server01.example.com
recipients=me@example.com
[BACKUP_JOB]
program=ntbackup
selection=@C:\Magik\data.bks
destination=<full=sun>\\nas01\backup\server01-Full.bkf
<inc=mon-sat>\\nas01\backup\server01-${nweekdayname}.bkf
verify=off
Each section describe a job. Common parameters can be put in the [DEFAULT] section. When a parameter is missing in the job definition, MKSBackup search in the [DEFAULT] section. If a parameter exist in both section, then the one in the job section is used. DEFAULT is not a valid job name.
Lines can be continued with leading whitespace, lines beginning with # (preferred) or ; are considered comments. Both keys and values are stripped of leading and trailing whitespace.
For more information about the job parameters, check the common parameters page and the related back-end page.
How to start it
MKSBackup must be run from the command line
The common usage is:
<mkbackup executable> [ -c <configuration file> ] <command> [ <JOB NAME> ... ]
At the end of the command, put the list of the jobs you want to do. MKSBackup will run them one after the other.
MKSBackup don't provide any scheduler. You have to use the scheduler provided by your OS if you want run it on a regular basis.
MKSBackup executable
MKSBackup is available as a .exe for Windows platform.
Unix but also Windows user can use the source mkbackup if python is installed.
configuration file
MKSBackup will use mkbackup.ini if unspecified. MKSBackup will try to guess the encoding depending the BOM if any or use windows-1252 on windows platform and utf8 on other. You can force an encodinng using the -e options. Valid encoding can be found here.
command
command can be one of :
- check to check the validity of parameters for the selected jobs.
- checkmail to send and email using the jobs parameters.
- backup to start the backup for real.
Troubleshooting
MKSBackup provide some help for troubleshooting. You can display error message on the console and increase verbosity. Anyway MKSBackup log all operations into mkbackup.log in the current directory.
Switches available are:
- -v To see logging on the console.
- -d to increase verbosity of the logging.
- -l logfilename to force logging to go into file logfilename. default is mkbackup.log
Sample
Using the INI file above, we will check our parameters before to start the backup or schedule a job. We will use the check command.
c:\magik\mkbackup\mkbackup.exe -c c:\magik\mkbackup.ini check BACKUP_JOB
MKSBackup is very verbose ! It first tell you a new version is available and where to download it.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
A new version of MKSBackup is available at
http://www.magikmon.com/mkbackup/index.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
check job="DATA" archiver="ntbackup"
logdir (default) C:\Documents and Settings\asx\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data
Error in section: DATA
selection='@C:\\magik\\data.bks'
file not found: C:\magik\data.bks
smtp_host='smtp.myprovider.com'
cannot resolve address
MKSBackup make a deep check of all parameters and report errors or warnings.
When all errors have been corrected, MKSBackup can do more ! Start the same command again !
check job="DATA" archiver="ntbackup"
logdir (default) C:\Documents and Settings\asx\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data
No error in section: DATA
Destinations by date:
Tue 29 Dec 2009 incremental \\nas01\backup\server01-Tue.bkf
directory not found !!!
Wed 30 Dec 2009 incremental \\nas01\backup\server01-Wed.bkf
directory not found !!!
Thu 31 Dec 2009 incremental \\nas01\backup\server01-Thu.bkf
directory not found !!!
Fri 01 Jan 2010 incremental \\nas01\backup\server01-Fri.bkf
directory not found !!!
Sat 02 Jan 2010 incremental \\nas01\backup\server01-Sat.bkf
directory not found !!!
Sun 03 Jan 2010 normal \\nas01\backup\server01-Full.bkf
directory not found !!!
Mon 04 Jan 2010 incremental \\nas01\backup\server01-Mon.bkf
directory not found !!!
ntbackup.exe backup @M:\asx\src\magik\data.bks /J DATA /M incremental /F
\\nas01\backup\server01-Tue.bkf /rs:no /v:no /r:no /l:s
In the INI file, we have defined a destination field using a curious syntax. This syntax define a location and a backup type depending on the day of the backup. This allow the user to dispatch the backup between multiple location depending on time.
To help the user to setup the destination field, MKSBackup display the list of the target for the next days. It can also check if the location exist and warn you.
At the end, MKSBackup display the command line it would have used to start the backend.
If you have used the checkmail command instead, it would have sent you these lines by email, to check the email configuration.
When you are ready run it this way !
c:\magik\mkbackup\mkbackup.exe -c c:\magik\mkbackup.ini backup DATA
When the job is done, it send you all related information by email, check details in the back-end page.
