Using copy.com as backup/sync destination

I’ve written guides on how to backup to both Dropbox.com and Box.com and now got the request via Twitter to write how to do the same thing with copy.com. Since I didn’t have a copy.com account I had to createtwitter_copy_com one before I could look into it.

The installation guide found in the documentation only works “out of the box” if you have a GUI running and none of my servers have one.

 

These are the steps to install and configure a headless installation of the Copy.com

Installation

All of the commands are executed as root, I can not guarantee that it will work as a regular user.

Change directory to /tmp and download the installation files.  The first time I tried to download the Copy.tgz file it failed with the error message:

To avoid this I added the parameter –no-check-certificate to the wget command

Extract the files

I then decided to copy the extracted folders and files to the /opt directory before running anything

The CopyAgent (as copy.com calls their software) comes in both a 32-bit and a 64-bit version and you need to run the correct one.

If you don’t know if your VPS is 32 or 64-bit you can check it by executing

The results will then tell you that:

The server I’m testing this on is 32-bit so I change directory to the x86 directory

To create the config files you need to run the CopyConsole command with the following parameters

!UPDATE!

-r is the root of the folder you want to backup. if you set this to /home, all sub-directories in /home will be uploaded to your account.

A suggestion is to create a /backups folder and then symlink folders to that /backups folder.

it should look something like this :

When executing config files are created and a synchronization is made with your online copy.com account.

Wait until you see this text at the bottom of your terminal

You can then exit by pressing CTRL+C

You will now have a new directory with all your config files in /root/.copy/.

The root directory that you specified above is now in sync with the online copy but if you add/remove a file in the root directory it won’t get uploaded since we stopped the CopyAgent.

To start syncing in the background you can start the CopyAgent with the parameter -daemon

To make sure it gets started every time the VPS is restarted I’ve added this row as a cronjob

 

That’s it. all done!

10 comments for “Using copy.com as backup/sync destination

  1. Joshua
    March 3, 2014 at 13:26

    Thanks for the tutorial mikho :D
    now im gonna use some of my copy storage to backup my vps

  2. Bambang
    April 10, 2014 at 07:45

    Hi.. thanks for the tutorial, but can I change copy home directory from root to my home folder?

    • April 10, 2014 at 11:02

      Yes, the -r parameter is the root directory that you will sync to copy.com

      Perhaps create a /home/box.com folder and link that to your online storage, then backup to /home/box.com and it will be synced to “the cloud”.

  3. Bambang
    April 10, 2014 at 17:23

    Thanks for reply. Btw when I try to add cronjob, it failed. Any other way around to start copy daemon when VPS restart?

    • April 10, 2014 at 20:53

      What error message do you get and what distribution are you using?

      • Bambang
        April 11, 2014 at 11:46

        I am using Debian 7 32 bit. There was no error message, I just looking current memory activities using top command, and CopyConsole daemon was no there. But I already find a way, create init.d script from Matteo Ragni script (https://gist.github.com/MatteoRagni/9271828), and it;s works for me.

        • April 12, 2014 at 20:12

          A solution that solves the problem is good enough for me :)

  4. curiouser
    October 26, 2014 at 05:32

    Hi, thanks a lot this informative post.
    As a noob w/ minimal Linux exposure, when I followed the above instructions, the sync was happening as the copy.com & centos 6.5whole vps being mirrors of each other.
    My questions are:
    1. can the mirrors be done via copy.com acct/vps1folder? I am trying to keep 2x vps control panels in the same copy.com account, if I can, only separated by folders
    2. Can you pls give us the command for mirroring as above.
    3. If question 1 can’t be done, can we just backup the home folder (where the control panel user backups are) rather than the whole vps?
    4. Command for step 3?
    Thanks again.
    cheers,
    curiouser

    • October 31, 2014 at 22:08

      I guess I wasn’t clear when I wrote the tutorial :)
      -r ==> -r is the root directory from where you backups should be taken.

      For instance I would create a /Backup folder first. Then set the parameter -r to that directory ( -r /Backups ).

      When all that is done and the software is installed, symlink your folders that you want to backup into the /Backups directory.

      To answer your questions:
      1. Not sure. I only used it to replicate contents to many servers.
      2. I would have to investigate on that.
      3. The solution is in the top of this reply.

      Sorry again for writing unclear instructions. I’ll update the post.

      • curiouser
        November 2, 2014 at 11:13

        Hi, thanks for clarifying that.
        And… finally got it going! Just opened up another account at copy.com for the 2nd vps
        cheers mate.
        curiouser

Leave a Reply

Your email address will not be published. Required fields are marked *