Home LINUX Tutorial Seven

7.1 HansaWorld Command Line startup and shutdown scripts

Control database startup and shutdown

/usr/bin/hansacontrol.sh

Linked to the following aliases in the /usr/bin directory

startdb.sh
stopdb.sh

Their purpose is to controll the startup and shutdown of of HansaWorld databases on LINUX based systems
The setup script will create symbolic links to /usr/bin/startdb.sh and /usr/bin/stopdb.sh

--startall start all hansaworld db's regardless of executed script name

--stopall stop all hansaworld db's regardless of executed script name

--init will recreate a default set of control files , password is 1n1t

--mkdirs will create dirs based on /etc/hansa.db , it will not erase existing paths

stopdb.sh without arguments will stop the database in the current
working directory if it matches an entry in /etc/hansa.db

stopdb.sh --stopall will stop all the HansaWorld databases listed in /etc/hansa.db

startdb.sh without arguments will start the database in the current
working directory if it matches an entry in /etc/hansa.db

startdb.sh --startall will start all the HansaWorld databases listed in /etc/hansa.db

You can also call the system init script to start and stop the databases , in RedHat derived Linuxes the root user can issue the command "service hansaworld start" or "service hansaworld stop" to start and stop all the registered databases on the server

 

7.2 HansaWorld Administraton Control files

/etc/hansa.conf

DBFILE=/etc/hansa.db          # path to database control file
BACKUPDIR=/u/HansaWorldBackups# location of online backup folder
FTPBACKUP=N                   # Perform ftp backup Y / N
FTPHOST=ftphost.mydonaim.com  # FTP host to send backup to
FTPUSER=myusername            # FTP host username
FTPPASS=mypassword            # FTP host password
CDBACKUP=N                    # Send backup to CD writer
USBBACKUP=N                   # Backup to external USB hard disk Y/N
USBDEV=backup                 # USB Disk filesystem label
TAPEBACKUP=N                  # Backup to tape streamer  Y/N
TAPEDEV=/dev/st0              # Tape streamer device name

7.3 HansaWorld database control file

/etc/hansa.db

HansaWorld Database startup control file
Comma seperated

Fields:

  1. Description / name of database
  2. Path to database
  3. IP Port used by database
  4. Backup flag , backup / nobackup
  5. Text backup management cycletext / deltext / leavetext

    cycletext will copy and compres text backups in the
    specified directory then copy to sub folder in the
    backup directory . The backup sub folder name is based
    on the description field in hansa.db

    deltext will delete all text backups in the specified directory.
    Text files will not be transfered to the backup directory

    leavetext will not touch text backups files in the specified
    directory. Text files will not be transfered to the backup
    directory
  6. Number of text backups to retain for cycletext
  7. IP Port used by web server and web shop
  8. Database Cache
    Possible suffix
    M megabyte
    G Gigabyte
    K Kilobyte
    N No Cache

Example layout of /etc/hansa.db

Live  database,/u/HansaWorldLive,1200,backup,cycletext,10,1300,2G
Test  database,/u/HansaWorldTest,1201,leavetext,deltext,10,1301,512M
Train database,/u/HansaWorldTrain,1202,nobackup,leavetext,10,1302,N
 

7.4 Automated routines

System startup and shutdown

At system boot time and system shut down the LINUX init mechanism will call scripts to start and stop services.
The UNILYNX HansaWorld control scripts are integrated into the server init machanisn to automaticly start/stop all the databases listed in the /etc/hansa.db control file in line with the server state.

Operating system backup timed by CRON

Backups are essential for the quick recovery from unforseen events. It is important that they be easily accessible and quick to restore. It is also essential that multiple copies of backups exist stored on removeable media or devices. Our scripting ensures that complete backup of the marked databases is made every night and stored on the server's disk system, Seven copies of the backup are stored on the server , one for each day of the week. The backup comprises a complete copy of the contents of the database folder including the database , attachments , HansaWorld binary, hob files and halcust.

The backup format is a tar archive comprising multiple gzip compressed tar archives, one for each database flagged for backup

a typical backup folder would be located at /u/HansaWorldBackups and contain a list of files like the following

[root@hansa HansaWorldBackups]# ls -l
total 70832600
-rwxrwxrwx 1 root root 10443581440 Oct 29 00:23 HansaBackupFriday.tar
-rwxrwxrwx 1 root root 10022871040 Oct 25 00:22 HansaBackupMonday.tar
-rwxrwxrwx 1 root root 10652323840 Oct 30 00:24 HansaBackupSaturday.tar
-rwxrwxrwx 1 root root 10652272640 Oct 31 00:23 HansaBackupSunday.tar
-rwxrwxrwx 1 root root 10356213760 Oct 28 00:22 HansaBackupThursday.tar
-rwxrwxrwx 1 root root 10140917760 Oct 26 00:22 HansaBackupTuesday.tar
-rwxrwxrwx 1 root root 10264360960 Oct 27 00:22 HansaBackupWednesday.tar
drwxrwxrwx. 2 root root 4096 Oct 31 09:26 Live--database-textbackups

In addition to the above the scripts can be set to copy the backup folder to various backup media

USB Disk - The system will mount a usb drive with the label specified in the hansa.conf file and use rsync to make a complete copy of the backup directory to the disk.

FTP Server - using the details in the control file a copy of the latest archive will be transfered to the indicated FTP server

Tape Streamer - using the details in the control file a copy of the latest archive will be transfered to the indicated tape device

CD/DVD - using the details in the control file a copy of the latest archive will be transfered to the attached CD/DVD writer


Please note CD/DVD provide a very unreliable backup solution

7.5 Installation

Setup of UNILYNX HansaWorld scripting for LINUX

Transfer a copy of the scripts to an empty directory on the LINUX host machine
Change permissions of the scripts to be read write and executeable

% chmod 777 *sh

run the setup script

% setup.sh

The script will take care of inserting the scripts into the init mechanism , copy the files to their varoius locations and insert entries into the LINUX CRON .

These scripts are designed to install and work on the following Linux's

NextDownload Unilynx HansaWorld scripts

 

 

 

Unilynx Business Systems 2011