Today I decided to upload some of our linux server backups to https://secure.cloudsafe.com/ Since CloudSafe offers free WebDAV access to all user safes I thought it would be nice to have my backup file uploaded regularly to a dedicated safe without having to interfere manually. So I wanted to share some information with you how to mount a CloudSafe safe as a regular network drive within linux.
Creating a safe at CloudSafe.com
(1) Login into CloudSafe
(2) Create a safe
(3) Go to the safe overview and enable WebDAV access
(4) Write down the credentials
Preparing your server
(1) Install davfs2 (a WebDAV file system based on FUSE):
On Ubuntu this will be one line:
apt-get install davfs2
For other linux installation guides please have a look at: http://savannah.nongnu.org/projects/davfs2
(2) Put the WebDAV URL, login name and login password of your Safe in a config file to automate login:
echo "(WebDAV URL) (login name) (login password)" >> /etc/davfs2/secrets
as an example:
echo "https://2078622604.webdav.cloudsafe.com/ support@cloudsafe.com BJAPQC-L6AEN4-CNRHBQ-HWVUKI" >> /etc/davfs2/secrets
(3) Make sure the file cache is large enough if you plan to upload big files.
echo "cache_size 100000 " >> /etc/davfs2/davfs2.conf
echo "use_expect100 0 " >> /etc/davfs2/davfs2.conf
(4) Create a Mountpoint for your safe
mkdir -p /mnt/safe
Now you are ready to mount your safe to your server's file system
Mounting the safe to your file system
(1) Mount your safe to /mnt/safe with a single line:
mount.davfs (WebDAV URL) /mnt/safe -o _netdev,noexec,nosuid
Use your safe's URL, as an example:
mount.davfs https://2078622604.webdav.cloudsafe.com/ /mnt/safe -o _netdev,noexec,nosuid
Now you can copy any data between your server and your CloudSafe safe at /mnt/safe. Just remember that transferring your files to and from CloudSafe will take some time. If you upload a few GB of data this could take a few minutes of time before they show up in CloudSafe.
If you want to dismount the safe from you file system please use this line:
umount.davfs /mnt/safe
We are using this with multiple mountpoints as well to automatically distribute some server data to non-technical staff. So in case they need to access some of the information they do not have to rely on some tech wiz with VPN and ssh access.