Backup opened remote files

Hello everyone. I have recently installed a Debian machine with duplicati. This PC will be a dedicated Backup server. In another location in the LAN I have a Debian Samba server to store files that many people in the company use.

My idea is to use the Dedicated Duplicati server to backup the files in the Samba Server, but many times users leave documents open, and i need to make sure that duplicati can backup those open files over the network. Is that possible? Is there something i need to look at in any of those servers?

Thank you very much in advance.

Hi @Joel and welcome to the forum.

TL;DR It depends, YMMV, and I’ll discuss. This might come down to identifying critical examples for testing.

This is an interesting question but possibly has no clear answer. Some locking schemes may use file-level locking, while others might instead use something simple like file presence without actual file-level locking.

Snapshot schemes such as Windows VSS can bypass file-level locking, but still can’t promise consistency between all the pieces an application uses (without app help). Especially if the server backup takes awhile, recommendations sometimes go towards taking a block-level snapshot in order to maximimize consistency.

You could try searching this forum for other talk about open file backup (there’s a lot around the Internet), however running remote over SMB is said to change locking behavior from what one might observe locally.

Local behavior (and likely other advantages) could be obtained by running Duplicati on the source server. Although I assume you don’t have any VPN issues, you can see what @Pectojin generally advises here.

The sort of file might also make a difference, e.g. a database somehow backed up while open might need additional recovery work (or not recover…) when restored, while a word processor might tolerate it better.

Possibly somebody with more experience will come by and take a stab at this rather complicated question, meanwhile perhaps you can say more about what sort of documents and other things might need backup. Testing on your own is also possible. You can take advice, but ultimately you probably want to see it work.

Applications that save the “open state” to the network share should work fine with Duplicati. However, it obviously won’t work if the application stores the state on the local machine and Duplicati is running on the networkshare machine.

Just for the record on databases. The only way to reliably back up a database is by directly interacting with the database on the database layer.

The way to do this with Duplicati is to NOT backup the database, but instead run a database dump and back up those database dumps. Duplicati does not understand the database transactions so simply backing up the raw database is gambling on data consistency.

These dumps can either be scheduled outside Duplicati or run as part of the run-script-before option.

The devil is in the details, and I’m not much of a lock expert, but in theory a level of remote lock support exists. Both NFS and SMB support file locking across the network, however counting on “local” behavior seems risky, and one is also exposed to more risk of versions, implementations, configs, and bugs. It’s hard to recommend.

https://www.centos.org/docs/5/html/Deployment_Guide-en-US/ch-nfs.html

https://tools.ietf.org/html/rfc7530

https://www.samba.org/samba/docs/old/Samba3-HOWTO/locking.html

Just a little pushback on “obviously won’t work” :grin:, though the conclusion is the same. Thanks for your input!

Well, thanks everybody for your input. At the very least i know what to face, and you guys provided good documentation to read on.

Unfortunately, Not doing backups is not an option, and a backup with more risk of versions is better than not a backup at all. There is a company policy to close documents when leaving, we will just have to be a bit stricter enforcing it.