WebDAV as backup destination

NethServer Version: NS7RC3
Module: backup
I am configuring backup on NS7 server. I would like to mount a remote directory prior to the backup start so I can backup to that remote directory. After the backup is finished I want to unmount the directory again.
Are there options to give a command before (mount) and after (umount) the backup process?

IIRC that’s the default behavior.

hmz… I was looking for another protocol to use… I’d like to use webdav instead of the offered cifs or NFS…

There are pre-backup and post-backup events:
http://docs.nethserver.org/projects/nethserver-devel/en/v7rc/backup.html#id2

@giacomo might be able to help you on setting additional actions for them, but I don’t know what else is needed for webdav backups.

Duplicity supports webdav protocol for backups, but NethServer scripts currently doesn’t ( https://github.com/NethServer/nethserver-backup-data/blob/master/root/etc/e-smith/events/actions/backup-data-duplicity#L95 )

You could try to workaround the problem as Marc suggested.

Tried to implement WebDAV for backups using davfs mounts. Didn’t look into duplicity’s WebDAV support though, so I don’t know if I’m taking the longer/wrong road.

ATM it’s more a P.O.C. than anything else. Just user and password authentication, as the image shows.
It does not handle certificates (but they can be set through command line).
It’s missing some validations (url, etc.)

  • Thought to use a button list to call other modules showing an upload form and listing the currently uploaded server/client certificates.
  • Another complementary though was to use openssl s_client to auto-retrieve the webdav server certificate and ask the user for approval before storing it.

Did some tries (weeks ago) but failed miserably due to lack of knowledge. Couldn’t call any sub-module, don’t know which classes to extend/implement, methods to call or… zero nada zilch. :sob:

5 Likes

@dnutan: absolutely awesome!! I can realy use this since tehre is a free webdav option available in trhough stack from transip: https://www.transip.nl/stack/
Leave an emailaddress and you can sign up for 1TB free storage space. It is an own/nextcloud storage and webdav is supported. So using duplicity you can store your encrypted backups safely in an offsite place.

@dnutan don’t give up…after each issue solved your code will be better.

2 Likes

Thanks to @dnutan, this feature is now available from nethserver-testing:

yum --enablerepo=nethserver-testing update nethserver-backup-{config,data}

Great work! :heart_eyes:

See also:

https://github.com/NethServer/dev/issues/5235

3 Likes

I have this feature working for 2months now and it runs like a charm! THNX @dnutan!

@quality_team please help @dnutan to test this feature out! That’s a great achievement by a learning dev :nerd:

@giacomo, thanks for review.
@davidep, thanks for testing and reporting a bug. I think this will fix it:

1 Like

The new feature is still in testing stage. @dz00te do you have any update? Anybody else tested it? /cc @quality_team

no sorry, i still miss to test over https (davs)… the idea was to test over nextcloud 11 but i had some problem with it (but this is another story…)

1 Like

…so does it work today? :grin:

1 Like

yes :slight_smile: lot better now :sunglasses:
tested on a clean install ns7 i’ll do other tests on a ns7 with more data to backup

1 Like

Right, duplicity archives could hit PHP upload limits and similar… :fearful:

i have just tried to set a bigger upload size (in Additional Settings > File Handling)
in nc11 log:
Warning files Can’t write upload limit to /usr/share/nextcloud/.user.ini. Please check the file permissions 2017-04-05T15:41:10+0200

solved by changing the owner …

1 Like

@dz00te can you verify and complete this issue?

yes, now that i have a webdavs over nextcloud11 fully working i can continue the tests. :grin:
For now i can say that the full backup works great every night, on a ns7 with no data on it. i’ll try to put some data on it 2-3 GB and retest full and incremental backup.

1 Like