Server Backup using Dropbox (A 5 Minute Setup)
I am one of those people who, despite knowing the risks, fail to make appropriate backups of my work and important data and rely on hope that nothing will go wrong. Unfortunately I have been caught out on a couple of occasions and I have been after a nice way to backup my data (documents, websites under development, family photos etc) from my home Fedora Core server without me having to really do anything.
I have seen several online backup software solutions, however most have to be configured and managed via GUI applications installed on your computer however as I have been wanting to back up a Fedora Core server which is command line only, this options was not available to me. A few people suggested Dropbox to me for sharing files between home and work computers and when looking into Dropbox I found that it can also be set up with a service on my Fedora Core server and configured to backup the data on my server.
The basic steps I performed to setup Dropbox to backup my Fedora Core server below:-
Note: You will need to complete the following as root or a user with sudo privileges
1) Create a file called dropbox.repo in /etc/yum.repos.d/ and paste the following text into it
[Dropbox] name=Dropbox Repository baseurl=https://linux.dropbox.com/fedora/$releasever/ gpgkey=https://linux.dropbox.com/fedora/rpm-public-key.asc
2) Install Dropbox (and necessary dependancies) using yum
yum install nautilus-dropbox
3) Create the file /etc/sysconfig/dropbox and add a line similar to the one below to specify which users are allowed to run Dropbox (substitute user1 and user2 as appropriate)
4) Download the startup script for Fedora Core from https://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall/FedoraStartup and it save to /etc/rc.d/init.d/dropbox 5) Set the permissions on the configuration and startup script files for Dropbox
chmod 755 /etc/rc.d/init.d/dropbox chmod 644 /etc/sysconfig/dropbox
6) If you want Dropbox to start automatically when the system is restarted, run the following command
chkconfig dropbox on
Note: If you wish to run Dropbox as a user other than root then switch to that user before running the following commands:- 7) Run the following command and install the proprietary daemon required to run Dropbox as a service
dropbox start -i
8) Once installed run the command again and copy and paste the URL you are given into a web browser and log into your Dropbox account or sign up for a new account to link this server to that Dropbox account. 9) Start the service by running the following command (as root or via sudo)
9) All that is left to do is symlink the folders you want backed up into the Dropbox folder (which can be found in the home directory of the user your ran steps 7 & 8 from) and then when you log into your Dropbox account online you should see there files and folders in your account.
Pros & Cons
The benefits I have identified include:
- Realtime online backup
- Do not need to remember and perform backups anymore
- Ability to share certain folders meaning you would not necessarily need to sync all the files to your other computers (although this would essentially require multiple dropbox accounts)
And the potential pitfalls include:
- I have several web projects using SVN for version control and all the .svn folders are included within Dropbox. Unfortunately there does not appear to be the usual options I would expect for excluding folders or files.
- As Dropbox treats symlinks as real directories you will need to ensure there are no circular references or Dropbox will continually loop round this circular reference.
Dropbox for linux - https://www.dropbox.com/downloading?os=lnx
Text Based install for Dropbox for Linux - https://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall/
- January 13th, 2011