Anchal Nigam
2022-Mar-21 02:38 UTC
[Samba] Does samba have the ability to specify a backup location for files that are replaced/overwritten?
Yeah, I am too. But that only gets changes since the last sync/backup. If samba has some native features for this it could be very useful -- especially as protection against ransomware. My thought is, when a samba client writes a file through samba, the samba server knows if the file exists or not. So, at that point, if it could either create a backup of the file it is overwriting OR somehow use hard links, then you would always have instant backups. This way you'd always have instant backups. Imagine a client machine is hit with ransomware that starts encrypting files on the samba share. With a feature like this you'd still have backups on the samba server that the ransomware couldn't get to. -- Thank you! _Nacho On Sun, Mar 20, 2022 at 9:02 PM Philippe LeCavalier <support at plecavalier.com> wrote:> I do this with rsync. It's a passive approach in the sense that rsync > doesn't know if the client touched a file but if you create nightlies rsync > can check the differences and send those deletes to an archive. In fact, > this is how I provide backup services for most of my clients. Good luck. > Thanks, Phil > > > On Sat, Mar 19, 2022 at 12:03 PM Anchal Nigam via samba < > samba at lists.samba.org> wrote: > >> I want it so every time a client modifies an existing file from a samba >> share, samba, on the server, will make a backup copy of the file first. >> Either by making a backup or using some kind of hard-link mechanism. >> >> -- >> Thank you! >> _Nacho >> -- >> To unsubscribe from this list go to the following URL and read the >> instructions: https://lists.samba.org/mailman/options/samba >> >
Andrea Venturoli
2022-Mar-21 07:19 UTC
[Samba] Does samba have the ability to specify a backup location for files that are replaced/overwritten?
On 3/21/22 03:38, Anchal Nigam via samba wrote:> My thought is, when a samba client writes a file through samba, the samba > server knows if the file exists or not. So, at that point, if it could > either create a backup of the file it is overwriting OR somehow use hard > links, then you would always have instant backups. This way you'd always > have instant backups.The closest thing that comes to mind is vfs_recycle. AFAIK it only saves a file when it's deleted, not modified, but perhaps it could be a starting point if you have some developer skills.> Imagine a client machine is hit with ransomware that starts encrypting > files on the samba share. With a feature like this you'd still have backups > on the samba server that the ransomware couldn't get to.Not exactly what you asked, but I keep frequent ZFS snapshots. bye av.