To restart the system issue the command reboot or press Control-Alt-Delete on the console.
Backing up the System
It is important to backup your op5 System to be able to restore configuration and important data in case of a system failure.
There are several ways to backup the system. Since op5 System is based on CentOS 5 most large providers of backup solutions has clients that can be installed on the op5 System.
For those cases where backup possibilities for linux systems does not exist we have created a backup utility called op5backup that can create backups of system configuration data and op5 product configurations and data.
op5backup consists of a backup script and a restore script. The backup script op5-backup can be scheduled to run using cron and it can place the backups in a local or remote mounted directory or transfer the file to another server over FTP.
Note: op5 backup will not backup logs of op5-logserver, so you better have remote archive setuped for this, or backup them manually.
Configuration
The main configuration file for op5backup is placed in the following file:
/etc/op5-backup/main.conf
Following variables needs to be set
transfer=, set this to ftp or local
if you use local as transfer location the configure this variable
storagepath=, set this to where the backup should be placed
If you use ftp as transfer mode then configure following variables
backupserver=, set this to a FQDN or ipaddress to you ftp server
backuppath=, set this to the path where you want your backups. Leave blank if no path is needed.
backupuser=, username for the ftp account
backuppass=, password for the ftp account
If you have added software or data to your op5 System that you want to be included in the backup you should add this to the /etc/op5-backup/modules/custom file.
The backup modules is written in bash uses a set of variables and functions. The table below describes the variables used in a backup module script
Variable | Description |
DESCRIPTION | A short description of the module. |
FILES_TO_BACKUP | The files and folders to backup with this module. It can contain both single files, filenames with wildcards like * and whole folders. |
WORKDIR | This is set in the op5-backup and op5-restore scripts and can be used in the backup modules. Users should not change redefine this variable! |
The following table describes the function used in a op5 backup module:
Function | Description |
CHECK | Used to check if it is ok to performe the backup specified in this backup module. If it is ok it should return 0 if not it should return 1. |
BACKUP_ACTION | Is used to specify actions performed before the actual backup is preformed. |
RESTORE_ACTION | Is used to specify what to do after a restore is performed. |
Here is an exemple of how a backup module could look like:
DESCRIPTION="Custom backup"
FILES_TO_BACKUP="
/opt/custom_app/etc/*.conf
/opt/custom_app/var/
"
function CHECK() {
rpm -q custom_app
return $?
}
function BACKUP_ACTION() {
mysqldump --databases custom_app > $WORKDIR/custom_app.sql
}
function RESTORE_ACTION() {
if [ -f $WORKDIR/custom_app.sql ]; then
mysql monitor_reports < $WORKDIR/custom_app.sql
fi
}
Schedule backups
To setup cron to execute this script you need to edit the following file.
/etc/cron.d/op5backup
For backups every day at 01.59 enter the following:
36 11 * * * root /usr/sbin/op5-backup >/dev/null 2>&1
For more information about the cron file execute the following command:
man 5 crontab
Restore backups
To restore a backup, execute the op5restore.sh script with the
backup-file as argument:
/usr/sbin/op5-restore [-h] -b backup_file [ -f ] [module...]
Options:
-h, shows this help
-b, the path to backup file to restore from
-f, restore files only. Do not execute any post-restore actions, such as restoring DB from dump.
Upgrade system via Internet
If your op5 Appliance system has HTTP connection to the Internet you can perform your upgrades directly with the yum command. Yum will get the files and data from the op5 repos.
To upgrade with the op5 repos
1 Log in, as the root user, to the server either directly on the console or via ssh.
2 Perform the upgrade with
yum upgrade
Upgrade system from iso file
If your op5 Appliance system hos no connection to the Internet you can still upgrade the system. All you have to do is to download the latest op5 Appliance system iso file.
To upgrade with the op5 Appliance system iso file
1 Create a CD-Rom from the iso file.
2 Insert the CD-Rom into your server.
3 Log in, as the root user, to the server either directly on the console or via ssh.
4 Create the folder /mnt/cdrom, if it does not exists.
mkdir /mnt/cdrom
5 Mount the CD-Rom
mount -o loop /dev/cdrom /mnt/cdrom
6 Execute the following command line to perform the upgrade
yum --disablerepo=\* --enablerepo=op5-media \
-c /mnt/cdrom/yum-media.conf update
7 Unmount and eject the CD-Rom
umount /mnt/cdrom ; eject
Useful commands