rsync Backup of Linux Server to Account

Home / Linux / rsync Backup of Linux Server to Account
rsync Backup of Linux Server to Account

We’ve built an Headless Ubuntu-Based Linux Virtual Server host machine using Oracle’s VirtualBox and phpvirtualbox for administration and setup a minimal Ubuntu installation and installed the CraftBukkit Minecraft server.  Now that we have it up and running, I want to configure an automatic backup of the Minecraft server files to the cloud using the free 50GB of storage that was kind enough to provide.

This tutorial will be done in two parts where the first part will be setting up the mount of our account and the second part will be scripting and scheduling the RSYNC operation of our Craftbukkit/Minecraft Server directory.

First we are going to need to install the davfs2 package to allow WebDAV file system support on our ubuntu server.

minecraft@mcserver:~$ sudo apt-get install davfs2

Now we need to reconfigure the davfs2 package and select YES to allow unprivileged users access to mount WebDAV resources.

minecraft@mcserver:~$ sudo dpkg-reconfigure davfs2

Now add your user account to the davfs2 grop:

minecraft@mcserver:~$ sudo adduser $USER davfs2
Adding user `minecraft’ to group `davfs2′ …
Adding user minecraft to group davfs2

Let’s make a directory to mount our account:

minecraft@mcserver:~$ mkdir ~/

And edit /etc/fstab:

minecraft@mcserver:~$ sudo nano /etc/fstab

And paste this line, (editing your username): /home/linuxusername/ davfs rw,user,noauto 0 0

Next let’s make the user-specific settings directory for davfs2 in our home directory:

nmino@mcserver:~$ mkdir ~/.davfs2

And copy the davfs2 config file to that directory for editing:

minecraft@mcserver:~$ cp /etc/davfs2/davfs2.conf ~/.davfs2

Now we need to edit the config file:

minecraft@mcserver:~$ nano .davfs2/davfs2.conf

The line to paste in the bottom of your davfs2.conf file is this:

use_locks       0

Now we need to copy the davfs2 secrets file to our user’s davfs2 settings directory:

minecraft@mcserver:~$ sudo cp /etc/davfs2/secrets ~/.davfs2

And change ownership of that file to the current user:

minecraft@mcserver:~$ sudo chown $USER ~/.davfs2/secrets

Now edit that file:

minecraft@mcserver:~$ nano ~/.davfs2/secrets

And put this at the end of the file PASSWORD

Where and PASSWORD are your account and password.

Save the file and then mount your account:

minecraft@mcserver:~$ mount

That’s it for the first part.  Our account is now mounted in our user directory as ~/

Now we can continue to creating our RSYNC backup script to copy our Minecraft server to the cloud.

3 thoughts on “rsync Backup of Linux Server to Account

  1. is this still working for you? I’m getting internal server error trying to access it with thunar or lftp.

Comments are closed.