Installing and running Copy.com agent on a headless (Ubuntu/Debian) Linux

I’ve started to use copy.com instead of services like Dropbox, SpiderOak and similar.

Why? Because it’s fast (unlike Dropbox), it’s simple (unlike SpiderOak) and it’s able to run on all major platforms (Windows, OSX, Android, iOS and Linux, both graphical and console. Both are native Linux application).

This article explains how to install the agent on Linux – more specifically how to run the console agent on a Ubuntu-derived distribution.

  1. Download the Agent
    $ curl -O https://copy.com/install/linux/Copy.tgz (or wget –no-check-certificate https://copy.com/install/linux/Copy.tgz)
  2. Extract it somewhere, in your homedir for instance
    $ tar zxvf Copy.tgz -C $HOME
  3. Create the needed directories
    $ mkdir $HOME/.copy $HOME/Copy
  4. Run the client by hand generate the required config
    $ $HOME/copy/x86_64/CopyConsole -r=$HOME/Copy -u=<copy.com user> –data=$HOME/.copy -debug
    Enter copy.com password and press enter when done
  5. Create a init script for the copy.com agent (/etc/init.d/copy)
    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides: CopyAgent
    # Required-Start: $local_fs $network
    # Required-Stop: $local_fs
    # Default-Start: 2 3 4 5
    # Default-Stop: 0 1 6
    # Short-Description: CopyAgent
    # Description: CopyConsole (Copy cloud storage by Barracuda) service
    ### END INIT INFO

    RUN_AS="myUser"
    HOME=`grep $RUN_AS /etc/passwd | cut -d":" -f6`
    CC="$HOME/copy/x86_64/CopyConsole"

    start() {
    echo "Starting CopyConsole..."
    if [ -x $CC ]; then
    start-stop-daemon -b -o -c $RUN_AS -S -u $RUN_AS -x $CC -- -daemon
    fi
    }

    stop() {
    echo "Stopping CopyConsole..."
    if [ -x $CC ]; then
    start-stop-daemon -o -c $RUN_AS -K -u $RUN_AS -x $CC
    fi
    }

    status() {
    dbpid=`pgrep -u $RUN_AS CopyConsole`
    if [ -z $dbpid ] ; then
    echo "CopyConsole for user $RUN_AS: not running."
    else
    echo "CopyConsole for user $RUN_AS: running (pid $dbpid)"
    fi
    }

    case "$1" in

    start)
    start
    ;;
    stop)
    stop
    ;;
    restart|reload|force-reload)
    stop
    start
    ;;
    status)
    status
    ;;
    *)
    echo "Usage: /etc/init.d/copy {start|stop|reload|force-reload|restart|status}"
    exit 1

    esac

    exit 0
  6. Make the script executable
    $ sudo chmod 700 /etc/init.d/copy
  7. Start the client
    $ sudo service copy start
  8. Enable autostart
    $ sudo update-rc.d copy defaults


Your agent should now be syncing to The Cloud.

copy