Updated September 2017
FreeBSD 10.3 w/ Retrospect 10.5 x64
After after our old Retrospect client gave "not enough memory" errors, I figured upgrading from the 32-bit 9.5 client to the 64-bit 10.5 client could be a good way to track down any resource issues. Luckily, FreeBSD now supports 64-bit Linux applications (it was limited to just 32-bit in the past).
Install the latest CentOS 6 binaries:
pkg install linux_base-c6
Run this to enable Linux in /etc/rc.conf:
sysrc linux_enable=YES
Load Linux:
kldload linux
Download the 64-bit Retrospect 10.5 Linux client:
wget http://download.retrospect.com/software/linux/v1050/Linux_Client_x64_10_5_0_103.tar
Extract the archive:
tar -xvf Linux_Client_x64_10_5_0_103.tar
Run the extracted script:
./Install.sh
Your output may look like this:
# ./Install.sh 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 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 "/etc/init.d" doesn't exist, the output of the command becomes the file 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
The Retrospect Server will use the mtab file to populate the list of Volumes for the client, so any locations you want to back up need to be listed in that file.
Here is a sample /compat/linux/etc/mtab file layout that you can use to back up some ZFS shares (modify with your paths):
/dev/da0p2 / ufs rw 0 0 zfs/share /zfs/share zfs rw 0 0 zfs/data /zfs/data zfs rw 0 0
If you use ZFS snapshots, this next part is important!
Whatever locations you added to mtab above, add their snapshot directories to the /etc/retrospect.excludes file, as well:
# exclude zfs snapshots /zfs/share/.zfs /zfs/data/.zfs
If you don't exclude the .zfs snapshot directories, Retrospect will scan them all during backups! This can greatly increase backup times.
Run this to enable Retrospect in /etc/rc.conf:
sysrc retro_enable=YES
Once you have the Retrospect client running, make sure to enable exclusions with this command:
/usr/local/retrospect/client/retrocpl -exclude on
This is the Retrospect service/script that we use. Save it as /usr/local/etc/rc.d/retro, and change the part with retroip to the IP of the local system.
#!/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 # caiton@wustl.edu # # 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). # # September 7th, 2017 # - updated retroclient startup command. # - removed checking /etc/sysctl.conf for compat.linux.osrelease. this # may not be needed in FreeBSD 10.3 and newer # - added checks to see if the service is running before trying to # start or stop it # - simplified script formatting and logging # # 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 client directory retrodir=/usr/local/retrospect/client # specify service log file logfile=/var/log/retro.log # current date & time, %F is the same as %Y-%m-%d, %T is the same as %H:%M:%S when=$(date +"%FT%T") # specify the IP address to bind to retroip=127.0.0.1 # command to start retrospect cmd="${retrodir}/retroclient -ip ${retroip} > /dev/null 2>&1 &" # 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 1 fi # check if retrospect is already running if [ `pgrep -x "retroclient"` ]; then echo "Retrospect is already running." exit 0 fi # log echo -e "\n${when}: -[Starting Retrospect Service]-" >> ${logfile} # what is going on echo "Starting Retrospect..." # run the startup command! echo "${when}: Running: '${cmd}'" >> ${logfile} eval ${cmd} # pause sleep 1 # done exit 0 } # stop service command retro_stop() { # are you root? if [ `whoami` != root ]; then echo -e "\n** This requires root. **\n" exit 1 fi # check if retrospect is already running if [ ! `pgrep -x "retroclient"` ]; then echo "Retrospect isn't running." exit 0 fi # what is going on echo "Stopping Retrospect..." # log echo "${when}: -[Stopping Retrospect Service]-" >> ${logfile} # run command ${retrodir}/retrocpl -stop # pause sleep 1 # done exit 0 } # status service command retro_status() { # check if retrospect is already running if [ ! `pgrep -x "retroclient"` ]; then echo "Retrospect isn't running." exit 0 fi # run command ${retrodir}/retrocpl # done exit 0 } # run one of the above commands run_rc_command "$1" # EoF
Retrospect should start on system boot. You can manage the service manually with these commands:
service retro start
service retro status
service retro stop