Search Engine: Elastic

Article ID: 1934, created on Jun 18, 2007, last review on Mar 17, 2016

  • Applies to:
  • Operations Automation 6.0
  • Operations Automation 5.5


OA backup script is included into the system package pleskd and is located in the folder /usr/local/pem/bin. The script has quite a few command-line options:

# /usr/local/pem/bin/ --help back up PEM subsystem or PEM server

Usage: [options]
--help                        This message
-o, -output-directory         Directory to place backup file to.
                              Directory will be created if it does not exist.
-z                            GZip produced tarballs
-t <tag>                      Make backup with specified tag. Valid tags are:
                              db - back up system DB
                              mn - back up Management Node files
                              ui - back up all UI servers in PEM cluster
                              <arbitrary string> - create file backup from
                              specified list of directories
If tag is an arbitrary string, following options may also be used:
-x                            <path> - exclude directory or file <path> from
                              backup. This option may be specified
                              multiple times.
-h host, --host host          Specify host to backup. Backup file still will
                              be stored locally.

For example, to backup OA database every night at 1:10am, put the following line into /etc/crontab:

10 1 \* \* \* root /usr/local/pem/bin/ -o backups_dir -t db

where <backups_dir> is the destination backup folder, which can be NFS mounted share.

If you do not wish to receive script output by e-mail (cron sends output to root by default, see MAILTO variable in /etc/crontab),  append the string with >> /dev/null:

10 1 \* \* \* root /root/scripts/ -o backups_dir  -t db >> /dev/null

Another predefined types of backups are:

  • mn - create backup of OA management node files
  • ui - create backup of all UI servers in OA installation

Corresponding entries in the file /etc/crontab may look like this:

10 1 \* \* \* root /usr/local/pem/bin/ -o backups_dir -t mn
10 1 \* \* \* root /usr/local/pem/bin/ -o backups_dir -t ui

You may also want to exclude some folders from backup which contain much static data which are not changed often, e.g. these ones:

  • /usr/local/pem/var/cores - core dumps from OA components
  • /usr/local/pem/vhosts - virtual hosts
  • /usr/local/pem/sysvhosts - system virtual hosts (since OA 2.9, e.g. - PPM packages repository is placed there)

    In this case you need to pass an arbitrary string in the parameter -t to name backup and corresponding entry in the file /etc/crontab may look like this (put it as a single line):

    10 1 \* \* \* /usr/local/pem/bin/ -o /backup -t mn-custom -x /usr/local/pem/var/cores -x /usr/local/pem/vhosts -x /usr/local/pem/sysvhosts /usr/local/pem/

    Pay attention to the fact that folders in parameter -x must be put without trailing slash /, e.g. /usr/local/pem/var/cores, not /usr/local/pem/var/cores/.

    The command above will create backup of the whole folder /usr/local/pem excluding the subfolders /usr/local/pem/var/cores, /usr/local/pem/vhosts and /usr/local/pem/sysvhosts, the backup will be placed in the folder /backup. This will allow to exclude static content from backups and make them smaller in size.

5356b422f65bdad1c3e9edca5d74a1ae 8fc71f07abe5b233fea1ae0377cd5e3d 5b048d9bddf8048a00aba7e0bdadef37 2554725ed606193dd9bbce21365bed4e 956c448bddc7e1f3585373687602379f 6f1456866eed87488c0f02b298a741c0

Email subscription for changes to this article
Save as PDF