AXIGEN Mail Server - Backup and Restore tools
=============================================
Summary:

1. Introduction
2. Usage and obtaining help
3. Backup
4. Restore
5. Compatibility note


1. Introduction
===============

The archive contains the backup and restore tools that can be used to perform incremental backup.
These tools are written in Python and work on Linux and Windows platforms. Please refer to "5. Compatibility note" for more details.
The tools are located under the "scripts/backup" folder:
  * axibackup.py - used for the backup operation
  * axirestore.py - used for the restore operation


2. Usage and obtaining help
===========================

 * run the scripts with no arguments in order to obtain the usage of the script
  
   axirestore.py
   Usage: axibackup.py [options] <mount dir> <backup dir>
   
   axirestore.py
   Usage: axirestore.py [options] <mount dir> <backup dir>

 * for help use the -h option
  
   axibackup.py -h
   Usage: axibackup.py [options] <mount dir> <backup dir>
   
   Axigen backup utility.
   
   Options:
     --version             show program's version number and exit
     -h, --help            show this help message and exit
     -H HOST, --host=HOST  axigen cli service host name (default: <localhost>)
     -p PORT, --port=PORT  axigen cli service port (default: 7000)
     -u USER, --user=USER  axigen cli login user name (default: <admin>)
     -P PASSWORD, --password=PASSWORD
                           axigen cli login password

  axirestore.py -h
  Usage: axirestore.py [options] <mount dir> <backup dir>
  
  Axigen backup utility.
  
  Options:
    --version             show program's version number and exit
    -h, --help            show this help message and exit
    -H HOST, --host=HOST  axigen cli service host name (default: <localhost>)
    -p PORT, --port=PORT  axigen cli service port (default: 7000)
    -u USER, --user=USER  axigen cli login user name (default: <admin>)
    -P PASSWORD, --password=PASSWORD
                          axigen cli login password


3. Backup
=========

  The axibackup.py script will back up all the Axigen domains (an option to backup only one domain is not available). Example:
  
  axibackup.py -H 1.1.1.1 -p 7000 -u admin -P secret /mount/point /path/to/backup/folder
  
  where: 
    1.1.1.1 - should be replaced with the Axigen IP address
    7000 - should be replaced with the port configured for the CLI service in Axigen (default 7000)
    secret - should be replaced with the actual admin password
    /mount/point - should be replaced with the actual mount point
    /path/to/backup/folder - should be replaced with the actual path to the backup folder

IMPORTANT !!!
-------------
  * A full backup is performed when the axibackup.py is first executed
  * If you want to perform an incremental backup you should use the same backup folder for the subsequent executions of the script; 
    if you choose another backup folder or the backup folder does not contain the previously performed backup, a full backup will be
    performed again.
  * In case that the last backup failed the type of the next one will be full instead of incremental
  * To activate the debug mode please set USE_DEBUG system variable to True


4. Restore
==========

  The axirestore.py script will restore the content from a backup location. For example if you have a faulty domain that needs to be restored 
  from a backup location:
  
  1. delete the domain from Axigen
  2. create a domain with the same name in Axigen
  3. run the script:

  axirestore.py -H 1.1.1.1 -p 7000 -u admin -P secret /mount/point /path/to/backup/folder
  
  where:
    1.1.1.1 - should be replaced with the Axigen IP address
    7000 - should be replaced with the port configured for the CLI service in Axigen (default 7000)
    secret - should be replaced with the actual admin password
    /mount/point - should be replaced with the actual mount point
    /path/to/backup/folder - should be replaced with the actual path to the backup folder


5. Compatibility note
=====================

  The script was tested also on Windows x64 platform using the latest Dokany user mode file system library.
  Dokany Releases: https://github.com/dokan-dev/dokany/releases
  Dokany Readme:   https://github.com/dokan-dev/dokany/blob/master/README.md
