Emailgency logo
Your email

MKSBackup common features

Monitor and see all your backups in the same screen with MagiKmon ! more ...

This page bring together all features and parameters common to all back-end

The destination syntax

MKSBackup provide an original syntax to define where to save your backup depending on the date.

Destination is composed of rules, each rules is on a separate line and has the following format :

< type = time_selector > target

The type define the type of the backup and depend of the front-end. For example, ntbackup known: full, differential or incremental. Check the front-end documentation for possible values.

The time_selector is a comma separeted list of time atome. Atome can be day name or day number. If one atome match the day then the target part becomes the backup location.

The target is the directory or the file where to store the backup. The target can contain time related variables.

Some samples will help you to understand the syntax.


This unique rule tell MKSBackup to run a full backup every day, and store it in a different archive every day of the week. ${nweekdayname} is a variable and will be replaced by the name of the day.


Above, MKSBackup will do a full backup on Sunday and an incremental every two days.

A week divisor can be used, if you want to change the backup location every weeks. If you use a week divisor, you need to define the first day of the week. This is useful when you want to dispatch your backup between multiple destination, to keep more than one week of backup.


Above the week divisor is 2 and the week start on Sunday. w in wsun means week and is used to distinguish wsun from the normal day selector sun. This means we have 2 directories S:\backup\week0 and S:\backup\week1 in wich we will have the file data-full-Sun.bkf, and data-inc-Mon.bkf up to data-inc-Sat.bkf. ${nweek} will be replaced by the number of the week in the cycle of two weeks, here 0 or 1.


Above we are backuping on \\nas_alpha and \\nas_beta, switching every week.
wsat0/2 means:

It is also possible to deal with day of the month and month.


Above we are doing a full backup the first of January and July. ${nmonthname} will be replaced by the abbreviated month name.

Days, week days, month can be mixed toghether.


The day will match the rule above if the day of the month is between 1 and 7 and if the day is a Sunday and if the month is January or Juli. In other word we are doing a full backup the first Sunday of January and July.

Valid Day of the month are decimal number between 1 and 31.

Valid weekday are :

mon, tue, wed, thu, fri, sat, sun

Valid month are :

jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec


MKSBackup allow you to customise the target location and name using build-in variables. Here are the time variables: Using a different notation, MKSBackup provide also these variables : Some front-end provide also specific variables, look the front-end page fore more.

The environment variables

The variables defined in the environment are available from inside the destination syntax. For example, under win32 architecture, ${COMPUTERNAME} will be replaced by the host name

The night shift

Most of the time your backups will run during the night. It will start before or after midnight. Even if the day change at midnight, the night is still the same and their is no reason to give different name to a backup started at 23:00 and one started 2H later at 1:00 !

This is why MKSBackup invent the night shift. When enable, the first rule of the destination below,


will match Sunday April 25 at 22H00 but also Monday 26 at 2H00. And in both case the target is \\nas01\backup\data-full.bkf.

This allow you to have uniformity in your file naming, for all your backups running during the night.

night_shift (default is on)

This allow you to enable the night_shift for one job or for all job if set in the [DEFAULT] section.


These variables will vary with the night shift when set or match the real date and time when not set :

The mail configuration

mail (default is yes)

This enable or disable the check of the mail configuration and the sending of any email. Possibles value are yes, no or fail (to send an email only when backup fail).


smtp_host (default is

This the name or the IP address of your mail relay.

smtp_port (default in 25, 465, 587 depending of smtp_mode)

This the port to connect on the mail relay.


smtp_mode (default is normal)

Can be normal, ssl or tls



When you need SMTP authentication, this is the login.


When you need SMTP authentication, this is the password.


sender (mandatory)

This is the sender address for the emails MKSBackup will send. More and more mail relay expect a valid email address and a valid domain name !

recipients (mandatory)

This is a space separated list of email addresses. Each of them will receive the backup report, or test mail.

attachment_gzip (default is 100)

Attachment above this size will be gzip'ed.


attachment_size (default is 1000)

This is the maximum size of an attachment in K bytes. Attachment above this size will be skipped.


Here are some samples

The simple setup, using port 25, no SSL nor TLS, no authentication

A connection using SSL and authentication, default port for SSL is 465.

A connection using TLS and authentication, default port for TLS is 587. This configuration is the recommended one when using GMAIL smtp relay.

Send mail report via HTTP through MagiKmon

People having subscribed to the MagiKmon service can send the backup mail report via the HTTP protocol. The service monitoring their backups provides an URL they can use with the magikmon option below. The recipients set in the mail configuration are ignored in this process (except for the generation of the mail). If a forward has been configured for the MagiKmon service, then the report will be forwarded to this address.

Both, mail configuration and magikmon option can be set together ! The report will be first sent using SMTP protocol to the recipients, then it will be sent to the MagiKmon service.


This must refer to the address of the MagiKmon service monitoring your backup.


The full URL is available from Service panel of the monitoring service. Here 123 is the number of the service, and is used as a password to access this service, to avoid abuse.

To work, mail option sender and recipients must be set ! This is required to generate the body of the email ! Options attachment_gzip and attachment_size or their default values will be used too. This is required to generate a well formated email able to be forwarded later by MagiKmon.

Mail report

The mail report always use the same structure :

Mail Subject

The subject is formatted in a way to help the user to quickly sort emails. The usual format is :
MKSBACKUP <command> <status> <job_name>

Mail body

The mail body contains user friendly information, error messages and backup status.


To not overload the mail body, extra data are stored in attachments. Each front-end provides its own attachment files. Here are the common attachments, check the front-end page for specific's ones:


update_check (default is yes)

This is a boolean switch, if set to yes, MKSBackup will check for the availability of a new version and warn you at the beginning of each emails.