How to setup Jungledisk on Ubuntu server

Introduction

Jungledisk is an excellent application for making backup copies of your data. The way it works is that Jungledisk works with online storage providers to encrypt then transfer your data to the online storage service. Please see jungledisk.com for more details.

The installation and setup process for Jungledisk on a desktop computer is very easy and well designed. Setup on a desktop computer is simple enough that a computer novice can easily set it up, but setup on a server without a graphical user interface is more complicated.

These instructions are based on Ubuntu server 8.04, but should work for any version of Ubuntu and will probably work with any Debian based distro.

Prerequisites

There are some prerequisites that are good to have resolved in advance. They are:

  1. Create an account on jungledisk.com. At this time you will be asked to buy the jungledisk software. You have the choice of buying a perpetual license or a monthly license. I bought the unlimited or perpetual license. I think this step can be skipped if you only want to setup the limited time period trial.
  2. Download both the Linux and the USB versions of Jungledisk
  3. Setup your account with the online storage service. I used Amazon S3 so I browsed to aws.amazon.com/s3 and created an account and created an access key. You would follow a similar process to setup a Rackspace Cloudfiles account.

Generate the Jungledisk settings

We are now ready to begin the installation and setup steps. We don't start on the server. The first steps will be completed using any computer with a graphical user interface. This computer can be running Windows, Mac or Linux.

  1. Unzip the jungledisk-usb file that was downloaded in the Prerequisites. Then run the appropriate version of junglediskmonitor for your operating system. If jungledisk hasn't been configured yet, it will take you through a wizard. This wizard will create the configuration file for jungledisk.
  2. At the first screen that requires input you will be asked for your email address and jungledisk password. I think this can be skipped if you only want to try Jungledisk.
  3. The next screen allows you to choose the storage location for your data. Currently the choices are Amazon S3 and Rackspace Cloudfiles. I chose Amazon S3. I was then able to choose to use a Jungledisk managed account or setup my own amazon S3 account. Since I chose to use my personal S3 account, I was asked for the S3 access key ID and secret key. This was explained in the prerequisites section above.
  4. On the same screen you are also able to chose the online disk name and the security level.
  5. Since I chose high security, the next screen asked for the encryption key that will be used to encrypt the data.
  6. The next step in the wizard gives the option to use Jungledisk as an automatic backup or network drive. I chose Automatic backup.
  7. Then I selected the backup schedule that I want jungledisk to use and selected the directory to backup. Since this isn't run on the server, I just selected a directory and will edit it later. Make sure to put a checkmark in a directory and select the Backup Options and make sure that the "Advanced Options" are set correctly.
  8. Now the wizard is complete and the jungledisk-settings.xml file has been created in the same directory as junglediskmonitor.
  9. There is a manual modification that will need to be made to this file. First open the file with a text editor like Wordpad and search for the element with the name "directoryName" this line will be something like "<directoryName>C:\Users\kevin\Documents</directoryName>". The portion between the opening and closing tags should be replaced with the directory on the server that should be backed up. So you should end up with something like "<directoryName>/home/kevin</directoryName>"
  10. If you don't want to use the jungledisk WebDAV directory, I would recommend making another change to the jungledisk-settings.xml. Search for "ListenPort" then change the number between the ListenPort tags to 0.

Setup on the server

Now we are ready to work on the server. I will assume that you have SSH or console access to the server and are familiar with basic command line use.

  1. First we need to transfer the Linux version of Jungledisk to the server and untar the file.
  2. Now move the file "jungledisk" to /usr/bin/ by executing sudo mv jungledisk /usr/bin.
  3. You will also need to transfer the jungledisk-settings.xml to the server and move it to /etc/ by executing sudo mv jungledisk-settings.xml /etc. Since this file includes the keys to access your online storage account, I recommend an additional step for security. It is to change the file permissions on the settings file. That can be done by executing sudo chmod 600 /etc/jungledisk-settings.xml.
  4. The next step is to setup the script that will start and stop the jungledisk service on your server. To do that download this jungledisk init.d script or copy and paste this code into a file named "jungledisk".
    #!/bin/sh
    
    ### BEGIN INIT INFO
    # Provides:          jungledisk
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: control jungledisk
    ### END INIT INFO
    
    # Written by Kevin Swanson 
    
    JD_BIN=/usr/bin/jungledisk
    JD_SETTINGS=/etc/jungledisk-settings.xml
    
    . /lib/lsb/init-functions
    
    case "$1" in
    	start)
    		log_daemon_msg "Starting Jungledisk daemons"
    		start-stop-daemon --exec $JD_BIN --start -- --config $JD_SETTINGS
    
    		log_end_msg 0
    		;;
    	stop)
    		log_daemon_msg "Stopping Jungledisk daemons"
    		start-stop-daemon --exec $JD_BIN --signal QUIT --stop
    
    		log_end_msg 0
    		;;
    	restart|force-reload)
    		$0 stop
    		sleep 5
    		$0 start
    		;;
    	start-backup)
    		$0 stop
    		sleep 5
    
    		log_daemon_msg "Starting Jungledisk daemons and backup job"
    		start-stop-daemon --exec $JD_BIN --start -- -b --config $JD_SETTINGS
    
    		log_end_msg 0
    
    		;;
    	*)
    		echo "Usage: /etc/init.d/jungledisk {start|stop|restart|force-reload|start-backup}"
    		exit 1
    		;;
    esac
    
    exit 0
    

    Save this to your server and move it to /etc/init.d/.

  5. To set up Jungledisk to automatically start when you system boots and stop when you system shuts down, run sudo update-rc.d jungledisk defaults

Conclusion

You should now have Jungledisk installed and configured on your server.

The init.d script that I wrote includes options to start, stop, restart and start-backup. Start, stop and restart are pretty self explanatory. The start-backup option will start the jungledisk service and immediately kick off a backup job instead of waiting for the normally scheduled backup job (setup in jungledisk-settings.xml).

The jungledisk logs are saved in /var/log/jungledisk.log. This can be helpful if you are getting an error that you need to track down.

I almost forgot to mention this, but one of the most important things about backups is knowing how to restore the backup. As far as I know the Linux command line program doesn't include a restore feature, but the GUI version has a nice restore tool that allows you to drill down to a specific version of a certain file and restore just that version or do a full restore of your whole directory. Therefore it is important to keep your jungledisk-usb directory in a safe location with the final jungledisk-settings.xml file in that directory.

If you find any holes in this explanation or if it is helpful to you, feel free to leave a comment.

Files: 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Works with 3.0?

Do you have a procedure for the new 3.0 release of JungleDisk. It appears that the desktop application for Linux requires the GUI to run.

I don't think so

I haven't looked at Jungledisk 3 yet, but did a quick search and found this forum http://support.jungledisk.com/forums/30235/entries/83116. I think I will stick with 2.6 until I am ready to look at other options.