Sincronización de configuración de Elastix con Dropbox

Now that all kinds of clouds are such a trend, many ideas on how to take advantage of them are starting to emerge. One of the most preferred options is backing up information. Many people therefore opt for synchronizing their files with the cloud not only for the sake of backing up, but also for storing, or spreading their information and making it accessible from several locations or devices.

In view of the above, I decided to back up Elastix to the cloud.

In this article we will use the so-called service Dropbox in order to synchronize Elastix’s configuration files. In this way, in the event of a disaster in our Elastix server, we will be able to recover the files directly from the cloud, or to use the cloud as a versioning tool, where we can check how our configuration files have changed over time.

To begin with, a free Dropbox account will be more than enough. At the time this article is being written, a free account offers as well 2GB for storage. Assuming that we already have a Dropbox account, the first thing we will do is download Dropbox for Linux commands line. Even though not many people know there is a Dropbox client version for command line, it does exist, and it is official. We can download it with the following command.

[code language=”text”]
cd /opt/
wget http://www.dropbox.com/download?plat=lnx.x86
[/code]

This is the path for 64-bits: : http://www.dropbox.com/download?plat=lnx.x86_64  Then we unzip it.

[code language=”text”]
tar -xvzf dropbox-lnx.x86-1.2.49.tar.gz
[/code]

The result will be a hidden folder, so this may appear a little confusing. To have access to it, we should run the ls command with the option “a”.

[code language=”text”]
# ls -la
drwxr-xr-x 3 root root 4096 dic 16 13:38 .
drwxr-x— 9 root root 4096 dic 16 13:35 ..
drwxr-xr-x 4 1000 1002 4096 dic 5 14:21 .dropbox-dist
-rw-r–r– 1 root root 15789424 dic 16 13:37 dropbox-lnx.x86-1.2
[/code]

Then we run the dropboxd program, which resides within the folder named .dropbox-dist

[code language=”text”]

[/code]

./.dropbox-dist/dropboxd

Then, we will see a message asking us to link our computer to our Dropbox account.

[code language=”text”]
This computer isn’t linked to any Dropbox account
Please visit http://www.dropbox.com/cli_link?host_id=abeee9b1b5448a8ddaa336832470601

[/code]

Once we have visited the link that Dropbox asks us to (and once we have entered our account data), our Dropbox installation will show us a message like the following:

[code language=”text”]
This computer is now linked to Dropbox. Welcome Edgar.
[/code]

After that, we can send the application to the background so we can do other things from the console. The dropboxd application will be devoted to synchronize the contents of your account on the Elastix server. For this purpose, it will create a folder named Dropbox in the user’s home. For example, for the user “edgar”, the folder will be: /home/edgar/Dropbox.

Then, inside the /home/edgar/Dropbox folder, we create a symbolic link to the folder where Asterisk saves its configuration files /etc/asterisk

[code language=”text”]
cd /home/edgar/Dropbox
ln -s /etc/asterisk etc.asterisk.dropbox
[/code]

From now on, all Asterisks’ configuration files will be synchronized with ‘the cloud’ inside a folder that will be named “etc.asterisk.dropbox”. This is a groundless name, so you can use any name you like.

This way, we can create symbolic links for other folders of interest. The most interesting thing is that almost as soon as you modify a file in these folders, the changes will be already uploaded and available in Dropbox; and in case there are problems with certain settings that we may have changed, we can always obtain a previous version of the files through Dropbox. Nice, isn’t?

It is very important at this point to highlight something that the reader may have not noticed already.

Any modification that I make in the content of the configuration files (that I have synced with Dropbox), either from the Dropbox Web interface or from any device, WILL BE SYNCHRONIZED WITH THE ELASTIX SERVER!

It turns this feature into a powerful remote configuration tool for our server Elastix, but it can also be a little risky because if done incorrectly, we can leave our VoIP server without service.

I hope you have enjoyed this article. I have also attached a screenshot of the configuration files already synced with a computer, waiting for you to use this tool wisely 😉

Article taken from:

http://www.neomano.com/2014/05/sincronizando-la-configuracion-de-elastix-con-dropbox/