Skip to main content

Create a Backup Set


There are two ways to create a File backup set. One is to create it using AhsayCBS while another way is through ssh.

This guide will only discuss how to create a File backup set using ssh. If you prefer creating a File backup set using AhsayCBS, refer to this document for more information: AhsayCBS Run on Server Backup and Restore.

  1. Select (5). Generate new Backup Set Settings Template from the "Main Menu".

    Main Menu
    			---------
    			(1). List Backup Sets
    			(2). Delete Backup Set
     			(3). Export Backup Set Settings to XML
     			(4). Import Backup Set Settings from XML
     			(5). Generate new Backup Set Settings Template
     			(6). Change Language [English]
     			(7). Update Profile Settings
     			(8). Quit
    			---------
    			Your Choice: 5
    		
  2. Select (1). File to generate a File backup set template to this directory:

    /root/.obm/config
    Choose a template from a backup set type
    			----------------------------------------
     			(1). File
     			(2). MySQL Database
     			(3). MariaDB
     			(4). Oracle Database Server
     			(5). IBM Domino
    			----------------------------------------
    			Your Choice: 1
    			XML file successfully exported to /root/.obm/config/backupSet.xml
    		
  3. Configure the backup set settings by editing the backupSet.xml file using a text editor, for example “vi”.

    You can either quit the RunConfigurator.sh script or open a new ssh session to edit the backupSet.xml file.

    Please refer to the Troubleshooting section of the Overview page for details and examples on how to create a backup set using the backupSet.xml file.

    Here is a sample File backup set setting.

    
    			>?xml version="1.0" encoding="UTF-8"?<
    			>Setting<
    				>!-- This is the backup set setting --<
    				>Key name="Backup Set Setting" allowMultiple="Y"<
    					>!-- Backup set type (Read Only) --<
    					>Value data="FILE" name="Type" type="string" /<
    					>!-- Backup set name --<
    					>Value data="BackupSet-1" name="Name" type="string" /<
    					>!-- Temporary directory for storing backup files --<
    					>Value data="/tmp" name="Temporary Working Directory" type="string"/<
    					>!-- Remove temporary files after backup --<
    					>!-- Y: Yes --<
    					>!-- N: No --<
    					>Value data="Y" name="Delete temporary files after backup"
    					type="boolean" /<
    					>!-- Support of opening backup data directly without restoration --<
    					>!-- Y: Yes --<
    					>!-- N: No --<
    					>Value data="N" name="OpenDirect" type="boolean" /<
    					>!-- Select compression type --<
    					>!-- GzipDefaultCompression : Normal --<
    					>!-- GzipBestSpeedCompression: Fast (Compressed size larger than
    					normal) --<
    					>!-- SnappyDefaultCompression: Fast with optimization for local --<
    					>!-- Leave the field blank for no compression --<
    					>Value data="SnappyDefaultCompression" name="Compression Type"
    					type="string" /<
    					>!-- Backup files' permissions --<
    					>!-- Y: Yes --<
    					>!-- N: No --<
    					>Value data="Y" name="Upload files permission" type="boolean" /<
    					>!-- Follow link of the backup files --<
    					>!-- Y: Yes --<
    					>!-- N: No --<
    					>Value data="Y" name="Follow links" type="boolean" /<
    					>!-- This includes the files you want to backup --<
    					>!-- Copy and paste the whole >Key< to add more selected sources --<
    					>Key name="Selected Source" allowMultiple="Y"<
    						>!-- Please enter your file path, e.g. /root/Documents --<
    						>Value data="/Documents" name="Path" type="string" /<
    					>/Key<
    					>!-- This excludes the files from the included source --<
    					>!-- Copy and paste the whole >Key< to add more deselected sources --<
    					>Key name="Deselected Source" allowMultiple="Y"<
    						>!-- Please enter your file path, e.g. /root/Documents --<
    						>Value data="/root/.obm" name="Path" type="string" /<
    					>/Key<
    					>Key name="Deselected Source" allowMultiple="Y"<
    						>!-- Please enter your file path, e.g. /root/Documents --<
    						>Value data="/usr/local/obm" name="Path" type="string" /<
    					>/Key<
    					>Key name="Deselected Source" allowMultiple="Y"<
    						>!-- Please enter your file path, e.g. /root/Documents --<
    						>Value data="/tmp" name="Path" type="string" /<
    					>/Key<
    					>!-- Settings for your scheduled backups --<
    					>Key name="Schedule Settings"<
    						>!-- Enable scheduled backup on this computer --<
    						>!-- Y: Yes --<
    						>!-- N: No --<
    						>Value data="Y" name="Enable" type="boolean" /<
    						>!-- Custom settings --<
    						>!-- Copy and paste the whole >Key< to add more daily schedules
    						--<
    						>Key name="Custom Schedule Settings" allowMultiple="Y"<
    							>!-- Name of schedule --<
    							>Value data="Custom-Schedule" name="Name" type="string"
    							/<
    							>!-- Start hour --<
    							>!-- 0, 1, 2... 23 --<
    							>!-- This value will be ignored if the schedule is set
    							to be periodic ("Interval" field contains value other than -1) --<
    							>Value data="21" name="Hour" type="integer" /<
    							>!-- Start minute --<
    							>!-- 0, 1, 2... 59 --<
    							>!-- This value will be ignored if the schedule is set
    							to be periodic ("Interval" field contains value other than -1) --<
    							>Value data="0" name="Minute" type="integer" /<
    							>!-- Duration of this backup in hours --<
    							>!-- 1, 2, 3... --<
    							>!-- A value of -1 means run until job finish --<
    							>!-- Duration can only be -1 if the schedule is set to
    							be periodic ("Interval" field contains value other than -1) --<
    							>Value data="-1" name="Duration" type="integer" /<
    							>!-- Date for performing custom schedule backup --<
    							>!-- Input in the format of YYYY-MM-DD --<
    							>Value data="2023-1-15" name="Schedule Date"
    							type="string" /<
    						>/Key<
    					>!-- This is the collection of destinations --<
    					>Key name="Destination Settings"<
    						>Value data="1" name="concurrency-level" type="integer" /<
    						>!-- AhsayCBS destination is where the files are backup to
    						server --<
    						>Key name="AhsayCBS Destination Settings" allowMultiple="Y"<
    					>/Key<
    				>/Key<
    				>!-- This shows the deduplication setting --<
    				>Key name="Deduplication Setting"<
    					>!-- Enable deduplication --<
    					>!-- Y: Yes --<
    					>!-- N: No --<
    					>Value data="Y" name="Enable" type="boolean" /<
    					>!-- Deduplication scope --<
    					>!-- F: Same file path within the same backup set --<
    					>!-- B: All files within the same backup set --<
    					>Value data="B" name="Deduplication level" type="string" /<
    				>/Key<
    			>/Key<
    			>/Setting<
    		
    • Before importing the backupSet.xml file please remove any unused destinations and backup schedule settings. Otherwise, the following error will be displayed "Failed to import XML file (Reason: Value of Name is empty!)" when trying to import the backupSet.xml file.

    • Setup of the following cloud storage destinations: OneDrive, OneDrive For Business, DropBox, and Google Drive are not supported in Linux CLI and FreeBSD environment, as these cloud storage destinations require authentication using a web browser.

  4. After editing the backupSet.xml file, import the XML file back to AhsayOBM so it can be uploaded to the AhsayCBS backup server to create the backup set. Select (4). Import Backup Set Settings from XML. Then select whether to enable encryption or not.

    
    			Main Menu
    			---------
     			(1). List Backup Sets
    			(2). Delete Backup Set
    			(3). Export Backup Set Settings to XML
    			(4). Import Backup Set Settings from XML
    			(5). Generate new Backup Set Settings Template
    			(6). Change Language [English]
    			(7). Update Profile Settings
    			(8). Quit
    			---------
    			Your Choice: 4
    
    			Reading xml...
    			Reading xml...Done
    			Verifying destination 'AhsayCBS'...
    			New backup set created.
    			Enable Encryption (Y/N) ? Y
    
    			Choose Encryption Type
    			----------------------
    			(1). Default
    			(2). User password
    			(3). Custom
    			----------------------
    			Your Choice: 2
    			XML imported, uploading to server...
    			XML successfully uploaded to server
    		
  5. To verify the uploaded backup set settings are correct, select (1). List Backup Sets. Then select the backup set you have created.

    
    			Main Menu
    			---------
     			(1). List Backup Sets
     			(2). Delete Backup Set
     			(3). Export Backup Set Settings to XML
     			(4). Import Backup Set Settings from XML
     			(5). Generate new Backup Set Settings Template
     			(6). Change Language [English]
     			(7). Update Profile Settings
     			(8). Quit
    			---------
    			Your Choice: 1
    
    			Select a Backup Set to show more details
    			----------------------------------------
     			(1). BackupSet-1
    			----------------------------------------
    			Your Choice: 1
    
    			Name : BackupSet-1
    			Owner : localhost.localdomain
    			Type : FILE
    			Selected Source : /root/Documents
    			Deselected Source : /tmp
    			Destination Name : AhsayCBS, Type: OBS
    			Encryption Key : abcdefg
    			Encryption Algorithm : AES
    			Encryption Mode : CBC
    			Encryption Key Length: 256
    
    			Press Enter to continue...
    		

    The backup set configuration is now complete!

    • We would like to stress that it is very important to keep a separate record of your encryption key in a safe place, as you will not be able to restore your data without the correct encryption key.

    • If you re-install AhsayOBM or install AhsayOBM on another machine the encryption key will be required for restoring data from the backup set.

  6. To verify the scheduled backup settings are correct, check the AhsayOBM scheduler log (debug.log) located in the folder:

    /root/.obm/log/Scheduler
    
    			# cat /root/.obm/log/Scheduler/debug.log
    			[2023/01/10 14:35:04][info] Loading profile...
    			[2023/01/10 14:35:04][info] Loading profile from server ...
    			[2023/01/10 14:35:04][info] Loading profile from server ... Completed
    			[2023/01/10 14:35:04][info] Loading profile... Completed
    			[2023/01/10 14:35:04][info] Profile is reloaded from server. Reloading
    			scheduler ...
    			[2023/01/10 14:35:04][info] [BackupSet-1 (1673331240190)] Next backup
    			will run in 6 hr 24 min 55 sec.
    			[2023/01/10 14:35:04][info] Profile is reloaded from server. Reloading
    			scheduler ... Completed