Open iBrotNano opened 6 years ago
Nice! Does this actually work, despite the filsystem limitations described in https://github.com/jotta/jotta-cli-issues/issues/7 ?
Sorry. I'm not sure about the NFS filesystem. I had a similar error first when i tried to backup data directly from within a docker container.
Unsupported filesystem [OVERLAYFS_SUPER_MAGIC]
It's the filesystem docker uses internally. By mounting the hosts filesystem with --mount type=bind
into the container i could work around this error message. Maybe the error is caused by the way NFS is mounted into the VM from #7 and not by NFS itself.
It's the same limits - they have made a whitelist of supported filesystems for some reason, probably to avoid someone doing something as cruel as to use space for multiple machines. That whitelisting filesystems thing doesn't make sense in these days of everything-virtual.
@torarnv Running jotta-cli v0.4 in a docker container with mounted system volumes works perfectly fine :)
I am using it for a while now and it seems to work quit good. I use it in conjunction with a script executed by a crontjob to backup some folder.
#!/bin/bash
backupFolderPath=/backups
# Cleanup of the backup folder by removing it completly.
rm -r ${backupFolderPath}
domain=example.com
# Creating the backup folder.
mkdir $backupFolderPath
# Creating a unique filename with a timestamp.
timestamp=$(date +"%F-%H%M%S")
backupFileName=${timestamp}-backup-${domain}.zip
destination=$backupFolderPath/$backupFileName
# Zipping the backup data.
zip -r ${destination} /home /var/lib/docker/volumes /etc
# Uploading the backup zip to the cloud.
docker exec jotta-cli jotta-cli archive /sync/${destination} --nogui
It zips some folders and uploads it to Jottacloud. It is not the most powerful backup solution but it is something.
Seems like someone elaborated on this: https://hub.docker.com/r/jaco1960/jottacloud
Haven't tried it though, but I will, if I can get my head around it..
jotta-cli release (
0.3.4269
):Publish the app as a docker image
Running the service in a docker container to backup stuff might be usefull.
Here is a dockerfile to create such an image and a instruction how to use it. It maybe useful some day.
Here is how to use it:
How can i create the image?
Install Docker
First remove all old installations of Docker if there are any.
The Docker package is renamed into docker-ce.
Then update the package cache.
You will need some dependencies to install Docker.
apt must know the gpg key for the Docker repository.
Ensure that always the stable version will be installed.
Update the package index again and install docker-ce.
You will need an additional component to compose Docker images.
Create the image
The image could be build now by changing the directory to the one the dockerfile is located. The dockerfile contains to
ARG
wich defines the versions of Ubuntu and jotta-cli. You can change them by passing arguments todocker build
.If you don't pass any arguments the defaults in the dockerfile will be used.
How can i use the image?
Prepare the container
First of all you don't want to configure jotta-cli every time you create a jotta-cli-container when you want to update jotta-cli. So you need to create a volume to persist the configuration.
The configuration files will be stored in the volume. On Linux the path is /var/lib/docker/volumes/jotta-cli/_data.
Now you can create the container.
You will notice that two mounts are made. The first mounts the created volume to /root/.jottad where the configuration is stored. The second mounts the hosts / into the containers /sync/. This way jottad could access the hosts filesystem to backup files. The hosts filesystem is mounted as readonly so that the container could not change anything on your host.
Keep attention to mount / only in a subfolder in the container!
Login into Jottacloud
To enter you Jottacloud credentials you must open a bash on the container. The output of
jotta-cli login
could not be displayed with Docker'sexec
command.In the container's bash log into your Jottacloud account.
Now you can exit the container with
exit
. Every other configuration could be made withexec
.The most important command it to add a path to backup.
This adds the path where Docker stores volumes to the observed folders. This way the container saves it's own configuration in the cloud.