Backup-data: multiple schedule and backends

stat /mnt/backup-backup-data/cloud/2018-09-18-201709/root/LOG_imapsync/2018_09_17_15_44_44_olivia\@lebrass.be.txt 
  File: ‘/mnt/backup-backup-data/cloud/2018-09-18-201709/root/LOG_imapsync/2018_09_17_15_44_44_olivia@lebrass.be.txt’
  Size: 11076           Blocks: 23         IO Block: 262144 regular file
Device: 29h/41d Inode: 326420      Links: 1
Access: (0600/-rw-------)  Uid: (  100/ UNKNOWN)   Gid: (  100/   users)
Access: 1970-01-01 07:10:45.000000000 +0100
Modify: 2018-09-18 20:17:21.492797411 +0200
Change: 2018-09-18 20:17:21.504797569 +0200
 Birth: -

Reading this https://serverfault.com/questions/212178/chown-on-a-mounted-nfs-partition-gives-operation-not-permitted it looks like this is the result of so-called “root squashing” that keeps the client to perform operations on the nfs server as root.

Since I don’t administer the nfs server, which is a backup storage provided by my hosting company, it looks like rsync will not work for me : the only other options are CIFS (which doesn’t support linux extensions and therefore hard links) and FTP (no comment).

Update. Their documentation states that

L’utilisateur NFS est root , les modifications de droits avec cet utilisateur peuvent générer des conflits avec des droits CIFS existants

Which translates roughly to

the NFS user is root, modifications to user rights using that user could create conflicts with existing CIFS rights

1 Like

Any thought to adding support for Duplicati? It’s got some nice features:

  • Built-in support for a number of cloud storage providers (Microsoft OneDrive, Amazon Cloud Drive & S3, Google Drive, box.com, Mega, hubiC, etc.), as well as standard protocols like WebDAV, FTP, SSH, etc.
  • Built-in AES-256 encryption of backup data
  • Has a decent web GUI of its own to set up backups (including getting authentication tokens from the cloud storage, if you’re using that), or it can run from the CLI as well.

There’s a CentOS-compatible RPM available, and yum does a fine job of tracking dependencies and such. After reviewing this write-up, getting it running on a Neth box only took a few minutes (the only difference was that I substituted config set fw_duplicati ... and signal-event firewall-adjust for the fw commands there.

1 Like

+1 for Duplicati, use it to back up a few remote machines already to S3 and works well.

1 Like

+3 for Duplicati.

I just took a quick look to duplicate manual: https://duplicati.readthedocs.io/en/latest/04-using-duplicati-from-the-command-line/
Some links are broken so I’m not sure how to fully configure it from command line.

If all Duplicati is published under an Open Source license, we could try to integrate it.
Before integrating, the software should have the following features (from command line):

  • inclusion and exclusion of a list of files and directories
  • execute a backup
  • restore a file or an entire backup in selected target directory
  • list backup content
1 Like

It is–it’s LGPL.

Supported, though I think it’d be by way of multiple --include and --exclude arguments, rather than by passing a list.

All of these are supported.

It looks like the “find” command could do something like this, though it isn’t immediately clear from the docs how you’d go about getting a list of all the contents of the most recent backup.

Edit: As to doing it on the command line, here’s the command line for the full system backup I’m running:

mono /usr/lib/duplicati/Duplicati.CommandLine.exe backup "googledrive://duplicati/main-neth-backup?authid=(redacted)" /root/ /var/lib/nethserver/ /var/lib/collectd/ /var/lib/rspamd/ /var/lib/redis/ /var/lib/sogo/backups/ /var/www/html/ /usr/share/nextcloud/config/config.php --backup-name="Main Neth Backup" --dbpath=/root/.config/Duplicati/DTGNDWJOQY.sqlite --encryption-module=aes --compression-module=zip --dblock-size=50mb --passphrase="(redacted)" --retention-policy="1W:1D,4W:1W,12M:1M" --run-script-before="signal-event pre-backup-data" --run-script-after="signal-event post-backup-data" --disable-module=console-password-input 
3 Likes

Hi there pagaille, is posible to ask You the command to configure a USB external disk for a backup, at the end of the year I have the disks to probe this new feature, but I have all the weekend trying to configure the drive for backup and is not posible.

Thanks in advance.

You can follow the instructions inside the manual: http://docs.nethserver.org/en/v7/backup.html#usb-disk-configuration

Otherwise, Cockpit already has a web interface which does the job. To install it:

yum --enablerepo=nethserver-testing install nethserver-cockpit

Then connect to: http://your_server:9090

1 Like

Hey @hector

I’m afraid the whole discussion here has been superseded by the new nethserver-backup package that addressed the issues I wrote here and much more.

As @giacomo mentioned it, the manual is quite extensive regarding the way you should configure external usb drive. I referred to it too.

More details would be useful to help you more extensively.

3 Likes

Hey giacomo, the cockpit was the answer for my problem Amazing job, nethserver 8 will be the top server to administrate, thanks , now is to check an error to edit the backup configuration.

@pagaille, thanks for the answer but the cockpit didit for me.

I need to rotate the hardrives every week (one drive is connected the other is in a bank locker), also i need to backup only 2 two days not 30d with rsync, I have to do it manualy but is not clear how to do it.

The failure on editing the backup config.

JavaScript Console in the browser.

Uncaught TypeError: b.props.NotifyTo.join is not a function
at VueComponent.initWizard (webpack:///./src/router/index.js_+66_modules?:2813)
at VueComponent.openEditBackupData (webpack:///./src/router/index.js
+66_modules?:3288)
at click (webpack:///./src/router/index.js
+_66_modules?:3488)
at invoker (webpack:///./node_modules/vue/dist/vue.esm.js?:2024)
at HTMLAnchorElement.fn._withTask.fn._withTask (webpack:///./node_modules/vue/dist/vue.esm.js?:1823)

Than you for reporting, I know @edoardo_spadoni is already working on it :wink:

Does anybody know the how to switch from 30 days of backup to only 2 days?.

Do I have to edit a file or is a command line db update.

The cockpit works amazing but doesn’t have that function.

Thank’s in advance.

From the doc here Backup — NethServer 7 Final

Retention policy

Each engine can implement its own retention policy. The policy can be set using the CleanupOlderThan property.

The property takes a number followed by D, M or Y (Days, Months, or Years respectively).

Example: cleanup after 30 days:

db backups setprop mybackup CleanupOlderThan 30D

The retention policy is not supported by the rsync backend.

1 Like

Thanks a lot, I was seaching inside the doc but could´nt find any thing.

I miss the magic words: RETENTION POLICY

The retention policy is not supported by the rsync backend.

Now is to search the script and edit the folder.

EJEJEJEJE, that was easy guys just edit : /usr/bin/rsync_tmbackup just search for KEEP_DAILIES_DATE=$((EPOCH - 172800)) # 2 days ago.

And set 2 days ago, now is to see the rsync next 2 days to know the behavior.

Amazing job!!!

Out of curiosity, why would you want to put a retention policy ? The rsync script is made to mimic Time Machine (Mac) behavior which fills the hard drive until free space is exhausted. From then it purges the oldest backups to make room for the next one.

That way your backup disk space is used as efficiently as possible.

I think you may have missed a point here; moreover you’re taking risks by modifying the script since it will be probably overwritten by future updates.

2 Likes

The retention policy for rsync has various bugs and doesn’t work as expected.
This is why the retention is not supported right now.

You can check the upstream repo and see if any fixes landed in the latest source tree.

:disappointed_relieved: I probed today It’ is not working. Going to check how to hack it!!!