Neil
Neil
Treat your password like your toothbrush. Don’t let anybody else use it, and get a new one every six months.

Amanda Network Backup

- Advertisement -

This article illustrates how, in about 15 minutes, you can: Install and configure the Amanda backup server.

Introduction

Amanda network backup is the world’s most popular open-source backup and recovery software because of its openness, robustness, functionality, and scalability. Yet it is straightforward to set up and maintain in production.

  • Prepare four machines (SLES 10, Fedora 8, Red Hat, and Windows 2000) for backup.
  • Set backup parameters.
  • Verify the configuration.
  • Verify the backup.

We will install and configure Amanda’s backup server software on Quartz, which runs (Centos)Red Hat Enterprise Linux. In addition, we will install and configure Amanda’s backup client software on Copper and on Iron. Finally, the Windows XP client, Uranium, will be backed up with server software running in convergence with Samba on the backup server, Quartz.

Installing Amanda Network Backup on CentOS

Ensure you are connected to the Internet for installing updates and server packages. Then, run the following command to update your system with the latest updates and patches.

root@unixcop ~]# yum install amanda*

Amanda will be executed by xinetd, so we need to install this along with some of its required packages on the system.

# yum install xinetd gnuplot perl-ExtUtils-Embed

Starting Xinetd Service

Now we have xinetd and Amanda backup server installed on our CentOS 7 Operating system. First, start the ‘xinetd’ service using the below command.

[root@unixcop ~]# service xinetd restart
Redirecting to /bin/systemctl restart xinetd.service
[root@unixcop ~]# systemctl status xinetd
● xinetd.service - Xinetd A Powerful Replacement For Inetd
   Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled; vendor preset: enabled)
   Active: active (running) since Fri 2022-07-29 15:23:53 UTC; 1min 44s ago
  Process: 1222 ExecStart=/usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid $EXTRAOPTIONS (code=exited, status=0/SUCCESS)
 Main PID: 1223 (xinetd)
   CGroup: /system.slice/xinetd.service
           └─1223 /usr/sbin/xinetd -stayalive -pidfile /var/run/xinetd.pid

Jul 29 15:23:53 unixcop.com xinetd[1223]: removing discard
Jul 29 15:23:53 unixcop.com xinetd[1223]: removing discard
Jul 29 15:23:53 unixcop.com xinetd[1223]: removing echo
Jul 29 15:23:53 unixcop.com xinetd[1223]: removing echo
Jul 29 15:23:53 unixcop.com xinetd[1223]: removing tcpmux
Jul 29 15:23:53 unixcop.com systemd[1]: Started Xinetd A Powerful Replacement For Inetd.
Jul 29 15:23:53 unixcop.com xinetd[1223]: removing time
Jul 29 15:23:53 unixcop.com xinetd[1223]: removing time
Jul 29 15:23:53 unixcop.com xinetd[1223]: xinetd Version 2.3.15 started with libwrap loadavg labeled-networking options compiled in.
Jul 29 15:23:53 unixcop.com xinetd[1223]: Started working: 0 available services
[root@unixcop ~]#

Verify the Amanda installation after its successful installation using the following command.

[root@unixcop ~]# amadmin --version
amadmin-3.3.3
[root@unixcop ~]#

Amanda Network Backup Configurations Setup

First, we will make some directories using the root user, but make sure and confirm your Amanda user, that probably “amandabackup” or “Amanda” or “backup,” depending on how you installed Amanda. We are using the default ‘amandabackup’ here to assign the ownership of the following directory structure.

[root@unixcop ~]# mkdir -p /amanda /etc/amanda
[root@unixcop ~]# chown amandabackup /amanda /etc/amanda

Now switch to your ‘amandabackup’ user and run the following commands.

[root@unixcop ~]# su - amandabackup

-bash-4.2$ mkdir -p /amanda/vtapes/slot{1,2,3,4}
-bash-4.2$ mkdir -p /amanda/holding
-bash-4.2$ mkdir -p /amanda/state/{curinfo,log,index}
-bash-4.2$ mkdir -p /etc/amanda/MyConfig
-bash-4.2$

So, all the data will be under the ‘/amanda’ folder, but you can put them wherever you want. Now, we will add an ‘amanda.conf’ file at ‘/etc/amanda/MyConfig/’ directory with the following contents.
This is the main configuration file for Amanda, the Advanced Maryland Automatic Network Disk Archiver. Let’s open this configuration file using your best editor and put the following contents. Remember to edit ‘dumpuser’ appropriately if your Amanda user has another name.

-bash-4.2$ vi /etc/amanda/MyConfig/amanda.conf
org "MyConfig"
infofile "/amanda/state/curinfo"
logdir "/amanda/state/log"
indexdir "/amanda/state/index"
dumpuser "amandabackup"

tpchanger "chg-disk:/amanda/vtapes"
labelstr "MyData[0-9][0-9]"
autolabel "MyData%%" EMPTY VOLUME_ERROR
tapecycle 4
dumpcycle 3 days
amrecover_changer "changer"

tapetype "TEST-TAPE"
define tapetype TEST-TAPE {
length 100 mbytes
filemark 4 kbytes
}

define dumptype simple-gnutar-local {
auth "local"
compress none
program "GNUTAR"
}

Many configuration parameters control the behavior of the programs. However, all have default values, so you need not specify the parameter in amanda.conf if the default is suitable. You can find the original configuration file under the ‘/etc/amanda/DailySet1/’ directory.
Next, we will add a ‘disklist’ file with a single disk list entry (DLE). The ‘disklist’ file determines which disks will be backed up by Amanda. The file contains a file directive or disklist access (DLE). General usage was to describe a DLE as a partition or file system.

-bash-4.2$ vi /etc/amanda/MyConfig/disklist
localhost /etc simple-gnutar-local

Check Amanda Network Backup Configuration

Amanda has an excellent utility called ‘amcheck’ which can check a configuration for you—running it on to test configuration that gives you the results of your configurations. Almost all commands take the configuration name as the first argument, like in our case, it is “MyConfig.”
Let’s run the following command to check the Tape Host Server configurations.

-bash-4.2$ amcheck MyConfig
Amanda Tape Server Host Check
-----------------------------
NOTE: tapelist will be created on the next run.
slot 1: contains an empty volume
Will write label 'MyData01' to new volume in slot 1.
NOTE: skipping tape-writable test
NOTE: host info dir /amanda/state/curinfo/localhost does not exist
NOTE: it will be created on the next run.
NOTE: index dir /amanda/state/index/localhost does not exist
NOTE: it will be created on the next run.
Server check took 0.121 seconds

Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 0.034 seconds.  0 problems found.

(brought to you by Amanda 3.3.3)
-bash-4.2$

Amcheck runs several self-checks on the Amanda tape server host and the Amanda client hosts.
On the tape server host, amcheck can go through the duplicate tape checking used at the start of the nightly amdump run to verify the correct tape for the next run is mounted. It can also do a self-check on all client hosts to ensure each host is running and that permissions on filesystems to be backed up are correct.
You can specify many host/disk expressions; only disks that match a phrase will be checked. All disks are checked if no words are given.

Run Test Backup

The test results are optimistic as we have seen no such error found that forced us to move forward. The tool to run backups is ‘amdump’. It takes only the configuration name, which doesn’t print anything to the terminal in its output. Let’s run as the user as shown below.

-bash-4.2$ amdump MyConfig

It will take a few seconds; you will probably not get output. So on the following line, run the following command that should give ‘0’ in output. If you see something other than zero, then the backup failed.

Amdump is the main interface to the Amanda backup process. It loads the specified configuration and attempts to back up every disk specified by the ‘disklist’. Amdump is normally run by ‘cron’ that we will show you in the next steps.
But, if you see something other than zero, then it means your backup failed. In that case, you can see a handy report of what happened to the backup by using the ‘amreport’ command along with your configuration file.

-bash-4.2$ amcheck MyConfig
Amanda Tape Server Host Check
-----------------------------
NOTE: tapelist will be created on the next run.
slot 1: contains an empty volume
Will write label 'MyData01' to new volume in slot 1.
NOTE: skipping tape-writable test
NOTE: host info dir /amanda/state/curinfo/localhost does not exist
NOTE: it will be created on the next run.
NOTE: index dir /amanda/state/index/localhost does not exist
NOTE: it will be created on the next run.
Amanda Backup Client Hosts Check
--------------------------------
Client check: 1 host checked in 0.034 seconds.  0 problems found.

(brought to you by Amanda 3.3.3)
-bash-4.2$ amdump MyConfig
-bash-4.2$ amreport MyConfig
Hostname: unixcop.com
Org     : MyConfig
Config  : MyConfig
Date    : July 29, 2022

These dumps were to tape MyData01.
The next tape Amanda expects to use is: 1 new tape.


STATISTICS:
                          Total       Full      Incr.   Level:#
                        --------   --------   --------  --------
Estimate Time (hrs:min)     0:00
Run Time (hrs:min)          0:00
Dump Time (hrs:min)         0:00       0:00       0:00
Output Size (meg)           32.8       32.8        0.0
Original Size (meg)         32.8       32.8        0.0
Avg Compressed Size (%)    100.0      100.0        --
DLEs Dumped                    1          1          0
Avg Dump Rate (k/s)      64893.6    64893.6        --

Tape Time (hrs:min)         0:00       0:00       0:00
Tape Size (meg)             32.8       32.8        0.0
Tape Used (%)               32.8       32.8        0.0
DLEs Taped                     1          1          0
Parts Taped                    1          1          0
Avg Tp Write Rate (k/s)   335500     335500        --

USAGE BY TAPE:
  Label               Time         Size      %  DLEs Parts
  MyData01            0:00       33550k   32.8     1     1

NOTES:
  planner: Adding new disk localhost:/etc.
  taper: Slot 1 without label can be labeled
  taper: tape MyData01 kb 33550 fm 1 [OK]


DUMP SUMMARY:
                                        DUMPER STATS                TAPER STATS
HOSTNAME     DISK        L ORIG-kB  OUT-kB  COMP%  MMM:SS    KB/s MMM:SS     KB/s
-------------------------- -------------------------------------- ---------------
localhost    /etc        0   33550   33550     --    0:01 64855.2   0:00 335500.0

(brought to you by Amanda version 3.3.3)
-bash-4.2$

Amanda Backup Scheduling

The daily execution of ‘amdump’ can be scheduled via cron daemon. However, nobody wants to remember to run the backups every night. That’s why we have cron! Let’s Add the following lines.

-bash-4.2$ crontab -e

0 12 * * * amandabackup /usr/sbin/amcheck -m MyConfig
30 1 * * * amandabackup /usr/sbin/amdump MyConfig
- Advertisement -

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook

x