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 create 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:
1 |
ERROR: The certificate of `copy.com' is not trusted. |
To avoid this I added the parameter –no-check-certificate to the wget command
1 2 |
cd /tmp wget --no-check-certificate https://copy.com/install/linux/Copy.tgz |
Extract the files
1 |
tar -xvf Copy.tgz |
I then decided to copy the extracted folders and files to the /opt directory before running anything
1 |
cp -r copy /opt |
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
1 |
uname -m |
The results will then tell you that:
1 2 |
x86_64 ==> 64-bit kernel i686 ==> 32-bit kernel |
The server I’m testing this on is 32-bit so I change directory to the x86 directory
1 |
cd /opt/copy/x86 |
To create the config files you need to run the CopyConsole command with the following parameters
1 2 3 |
-p ==> the p parameter is where you enter your password -u ==> the u parameter is where you enter your username -r ==> -r is the root directory |
!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 :
1 |
./CopyConsole -p=<the password used when signing up> -u=<email used when signing up> -r=<root folder> |
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
1 |
All files up to date |
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
1 |
./CopyConsole -daemon |
To make sure it gets started every time the VPS is restarted I’ve added this row as a cronjob
1 |
@reboot /opt/copy/x86/CopyConsole -daemon |
That’s it. all done!
Thanks for the tutorial mikho 😀
now im gonna use some of my copy storage to backup my vps
Hi.. thanks for the tutorial, but can I change copy home directory from root to my home folder?
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”.
Thanks for reply. Btw when I try to add cronjob, it failed. Any other way around to start copy daemon when VPS restart?
What error message do you get and what distribution are you using?
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.
A solution that solves the problem is good enough for me 🙂
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
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.
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
Is there any option I can copy only a file, for example I want to copy the file backedup by cPanel to copy.com
The API that copy.com provides can do single file uploads.
I will take a look and probably do a follow up post on this topic.
Hi there,
Is this technique still working?
I was able to set it up with your patient tutoring, but I have just realized that the backup process has stopped for the last couple of months.
Copy.com seems to have been doing a number of changes on their site, and could this’ve affected this backup process?
If you could write a tut on how to kickstart the stalled procedure, or if the old process has to be revamped to allow for the new copy.com system, it will be much appreciated!
cheers, and thanks for all your teachings…
Check if the process is still running. If it’s not, restart it by running that final command: ./CopyConsole -daemon from the directory where you installed it.
Does it run then?
apologies for the delayed reply, server was down.
Yes, that was the missing key for me
sync backup started up again.
thanks as always 🙂 …