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

 

  • andrea jvc

    Hello, I’m trying to use your Upstart script on ubuntu server 12.04.03 x86.
    Using – sudo start copy – copyconsole starts but the processor goes up to 99% while running the client by hand with:
    $HOME/copy/x86_64/CopyConsole -r=$HOME/Copy -u= —data=$HOME/.copy -debug
    works perfectly.
    Please can you give me a hint?
    Thanks, Andrea

    • ajoergensen

      I stopped using the Copy agent for the same reason but recently decided to give it another go – The problem seem to have been resolved in later versions of the agent.

  • Julio

    I come here to express my gratitude for making this post. Was very helpful in my work.

    Thanks Allan, continue the good work!

    Cheers

  • DeltaForce

    Thanks a lot!!. Your explanation was very clear

  • DeltaForce

    I have changed my password. How do I change the settings to the new password?
    thanks

    • kostas

      you have to modify your copy.sh file with your updated password
      its under user/home directory

  • kostas

    thank you so much…. your way was the only way to make it work.
    thank you again