Retrospect (backup software)


Despite any support from the company/companies that managed Retrospect (Dantz, EMC, Roxio, Retrospect Inc), it works amazingly well under FreeBSD.

We current run Retrospect 9.5 on our FreeBSD 9.3 and 10.1 servers.

Software download page (as of May 2015):
http://www.retrospect.com/en/support/archived

First, we install the CentOS 6 libraries:

pkg install linux_base-c6

We then add the following to /etc/sysctl.conf to get FreeBSD to use the newer kernel information from CentOS 6:

# change from Fedora 10/2.6.16 to CentOS 6.6/2.6.18
compat.linux.osrelease=2.6.18

We then add this to /etc/rc.conf to tell the system to load the Linux modules on startup:

# enable Linux:
linux_enable="YES"

Load Linux:

kldload linux

Download the 32-bit Retrospect client:

wget http://download.retrospect.com/software/linux/v950/Linux_Client_x86_9_5_0_113.tar

Extract the archive:

tar -xvf Linux_Client_x86_9_5_0_113.tar

Run the extracted script:

./Install.sh

Your output may look similar to this:

# ./Install.sh 
[: : bad number

Install Retrospect Client? (y/n): y

Enter first access password:
Retype the first access password:

Adding RETROSPECT_HOME to system profile and login scripts...Done!
Starting client as daemon... 
./Install.sh: /usr/local/retrospect/client/rcl: not found

./Install.sh: /sbin/pidof: not found
Installation was successful, but Retrospect Client for Linux could not 
be started. If this is an upgrade, please wait 5 minutes, then start 
the client manually by running  $ /usr/local/retrospect/client/rcl start
If your system uses an rc.local script, you should be able to start 
Retrospect Client for Linux automatically by adding the line 
'/usr/local/retrospect/client/rcl start'. Otherwise, consult your system 
documentation for the best method.

The installer will give errors, but that is normal (since this is an “unsupported” FreeBSD system).

The install script expected rcl to be created in /etc/init.d/. Since “init.d” doesn’t exist, the output of the command becomes the executable with that name.

The script also attempts to create a symbolic link to the file:
/usr/local/retrospect/client/rcl -> /etc/init.d/rcl

The “fixes” are to remove, rename, and correct some permissions.

Move the script and overwrite the incorrect symbolic link:

mv /etc/init.d /usr/local/retrospect/client/rcl

Correct some permissions:

 
chown -R 0:0 /usr/local/retrospect/
chmod o-x /usr/local/retrospect/client/*
chown 0:0 /etc/retrospect.excludes
chmod a-x /etc/retrospect.excludes

Here is a sample /compat/linux/etc/mtab file that we use to back up some ZFS shares:

/dev/da0p2 / ufs rw 0 0
zfs/share /zfs/share zfs rw 0 0
zfs/data /zfs/data zfs rw 0 0

Add this to your /etc/rc.conf file:

# start Retrospect (requires Linux support)
retro_enable="YES"

This is the Retrospect service/script that we use. Save it as /usr/local/etc/rc.d/retro. It has some limited logging.

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: retro
# REQUIRE: sysctl
# KEYWORD: shutdown
#
# /usr/local/etc/rc.d/retro
#
# Verify the IP address and Retrospect path below and then
# set the following in /etc/rc.conf to enable this service:
# retro_enable="YES"
#
# Retrospect service for FreeBSD
#
# Nicholas Caito
#
# November 6th, 2012
# - first version of script
#
# October 1st, 2014
# - updated for Retrospect 9.5 Linux client
# - added Server IP option (helps reduce log spam)
# - changed startup commands to better match Linux service
# - updated script with 'PROVIDE' for rcorder(8) so ".sh" isn't required
#
# February 6th, 2015
# - updated for change from Fedora -> CentOS
# - updated service to be compliant with "rclint -v" command
# - re-write of much of the commands to enable better logging, display linux kernel version,
#   and to force loading of "sysctl" (in order to set the correct linux kernel parameter).
#
# NOTE that the Linux kernel parameter for CentOS is set in /etc/sysctl.conf and that is
# usually not loaded until toward the end of the boot process.
#
# The work-around I have is to to attempt to start/load sysctl from this script.
#
# Note that the ORDER is very important in this file
# Verify the script with "rclint -v retro"
#

# load functions
. /etc/rc.subr

# name of service
name=retro

# make sure to set retro_enable="YES" in /etc/rc.conf to enable this service
rcvar=retro_enable

# service description
desc="Retrospect service for FreeBSD."

# load service config
load_rc_config $name

# enable 'status' parameter
extra_commands=status

# specify the IP address to listen on
retroip=127.0.0.1

# specify client directory
retrodir=/usr/local/retrospect/client

# get the date and time, %F is the same as %Y-%m-%d, %T is the same as %H:%M:%S
when=$(date +"%F, %T")

# default service start command
start_cmd="${name}_start"

# default service stop command
stop_cmd="${name}_stop"

# status command
status_cmd="${name}_status"

# start service command
retro_start()
{
	# are you root?
	if [ `whoami` != root ]; then
		echo -e "\n** This requires root. **\n"
		exit
	fi

	# original command      
        #${retrodir}/retroclient -ip ${retroip} &
		
	# log
        echo "[${when}] ---------- [SERVICE START] ----------" >> /var/log/retro.log
	
	# what is going on
	echo "Attempting to start Retrospect..."
	
	# define command line
	local cmd	
	cmd="${retrodir}/retroclient -ip ${retroip} &"
	
	# display what the linux kernel is set to
	echo "Pre-sysctl kernel version: $(sysctl -n compat.linux.osrelease)" >> /var/log/retro.log
        
	# load sysctl, which should set the new kernel version
	echo "Loading '/etc/sysctl.conf'..." >> /var/log/retro.log
	if force_depend sysctl >> /var/log/retro.log
	then
		# display the linux kernel version again
		echo "Post-sysctl kernel version: $(sysctl -n compat.linux.osrelease)" >> /var/log/retro.log
		
		# run the startup command!
		echo "Attempting to run '${cmd}'..." >> /var/log/retro.log
		eval ${cmd} >> /var/log/retro.log
	else
		# if sysctl cannot load, we might not have the correct kernel
		echo "Could not load '/etc/sysctl.conf'!" >> /var/log/retro.log	
	fi

}

# stop service command
retro_stop()
{
	# are you root?
	if [ `whoami` != root ]; then
		echo -e "\n** This requires root. **\n"
		exit
	fi
	
	# original command: ${retrodir}/retrocpl -stop
	#
	
	# log
	echo "[${when}] ---------- [SERVICE STOP] ----------" >> /var/log/retro.log
	
	# run command
	${retrodir}/retrocpl -stop

}

# status service command
retro_status()
{
	# original command: ${retrodir}/retrocpl
	#
	
	# log
	# echo "[${when}] ---------- [SERVICE STATUS] ----------" >> /var/log/retro.log
		
	# run command
	${retrodir}/retrocpl
	
}


# run one of the above commands
run_rc_command "$1"

# EoF

Old:


Software download page (as of November 2012):
http://retrospect.com/support/downloads

Direct link:
linux_client-7_7_100.tar


System used:
FreeBSD 9.1 x64

Additional software:
linux_base-f10


I couldn’t find any package to install with “pkg”, so installing from ports may be the easiest way:

# cd /usr/ports/emulators/linux_base-f10
# make install clean

Only *after* linux_base is installed, add this to /etc/fstab:

# procfs for linux (do *not* enable without linux_base)
none    /compat/linux/proc      linprocfs rw    0       0

Retrospect relies on the mtab file to exist. This will vary based on how your disks are mounted. If your root is on “da0s1”, then you’d want to tell Retrospect an ext4 file system is mounted in the /compat/linux/etc/mtab file like this:

/dev/da0s1 / ext4 rw 0 0

Finally, add this to /etc/rc.conf:

# enable Linux:
linux_enable="YES"

Now with Linux compatibility set up, it’s time to install Retrospect.
Extract the file downloaded from the above link, then run the “Install.sh” file to install it.

The install script expected rcl to be created in /etc/init.d/. Since “init.d” doesn’t exist, the output of the command becomes the executable with that name.

The script attempts this:
/usr/local/dantz/client/rcl -> /etc/init.d/rcl

But it ends up creating this:
/etc/init.d

To correct that, just run two commands:

# rm /usr/local/dantz/client/rcl
# mv /etc/init.d /usr/local/dantz/client/rcl

You will then want to tell Retrospect not to try and scan/backup your Linux /proc directory. Add this to the /etc/retrospect.excludes file:

# needed for FreeBSD
/compat/linux/proc

Here is a startup script you can use:

#!/bin/sh
#
# /usr/local/etc/rc.d/retrospect.sh
#
# Retrospect for FreeBSD
#
#

. /etc/rc.subr

name=retrospect
rcvar=retrospect_enable

start_cmd="${name}_start"
stop_cmd="${name}_stop"

retrospect_start()
{
         /usr/local/dantz/client/rcl start
}

retrospect_stop()
{
         /usr/local/dantz/client/rcl stop
}

retrospect_status()
{
         /usr/local/dantz/client/rcl status
}

load_rc_config $name
cmd="$1"

case "${cmd}" in
status | onestatus)
        retrospect_status
        ;;
*)
        run_rc_command "${cmd}"
        ;;
esac

#EoF

For the Retrospect service to start on every boot, add this to /etc/rc.conf:

# start retrospect
retrospect_enable="YES"

You will also need to run this to make sure Retrospect knows to use the exclusions file:

# /usr/local/dantz/client/retrocpl -exclude on