[Samba] shadow copy source

Piviul piviul at riminilug.it
Tue Oct 11 07:48:40 UTC 2022


On 10/10/22 14:57, Piviul via samba wrote:
> On 07/10/22 15:28, Nick Couchman via samba wrote:
>> I would think this would be possible, yes, you'd just need to make
>> sure that the rsync snapshots are put into a standard naming
>> convention that can be translated by the vfs_shadow_copy2 module the
>> date/time options it will present to Windows. You need the right
>> combination of the following options to parse out those rsync
>> directories:
>>
>> shadow:snapdir
>> shadow:sort
>> shadow:format
>> shadow:snapprefix
>> shadow:delimiter
>
> I never used shadow_copy2 VFS module... the rsync snapshots are in a 
> nfs share. I have mounted it on /home/shares-snapshots. The format I 
> use is the default value of shadow format value 
> ("@GMT-%Y.%m.%d-%H.%M.%S"). This is the content:
>
> $ ls /home/shares-snapshots/
> @GMT-2022.10.07-05.25.01         @GMT-2022.10.07-11.07.01 
> @GMT-2022.10.07-14.07.01         @GMT-2022.10.07-17.07.01 
> @GMT-2022.10.10-11.07.01
> @GMT-2022.10.07-05.25.01.log.gz  @GMT-2022.10.07-11.07.01.log.gz 
> @GMT-2022.10.07-14.07.01.log.gz  @GMT-2022.10.07-17.07.01.log.gz 
> @GMT-2022.10.10-11.07.01.log.gz
> @GMT-2022.10.07-09.07.01         @GMT-2022.10.07-12.07.01 
> @GMT-2022.10.07-15.07.01         @GMT-2022.10.10-09.07.01 
> @GMT-2022.10.10-12.07.01
> @GMT-2022.10.07-09.07.01.log.gz  @GMT-2022.10.07-12.07.01.log.gz 
> @GMT-2022.10.07-15.07.01.log.gz  @GMT-2022.10.10-09.07.01.log.gz 
> @GMT-2022.10.10-12.07.01.log.gz
> @GMT-2022.10.07-10.07.01         @GMT-2022.10.07-13.07.02 
> @GMT-2022.10.07-16.07.02         @GMT-2022.10.10-10.07.01 latest
> @GMT-2022.10.07-10.07.01.log.gz  @GMT-2022.10.07-13.07.02.log.gz 
> @GMT-2022.10.07-16.07.02.log.gz  @GMT-2022.10.10-10.07.01.log.gz
>
> for each hourly snapshot I have a log.gz file and a symbolic link 
> named latest that point to the latest snapshot. This structure should 
> be compatible is'nt it?
>
> So I have added to the smb.conf share section something like:
>
>     vfs objects = shadow_copy2
>     shadow:snapdir = /home/shares-snapshots
>     shadow:sort = desc
>     # shadow:format = @GMT-%Y.%m.%d-%H.%M.%S
>
> I haven't set the shadow:delimiter and  shadow:snapprefix I haven't 
> understand how to set them... any way are not mandatory, aren't they? 
> Well, I have reload samba but from windows in the file properties no 
> versions are available... what I wrong?

These are the log level 10 logs of a client accessing the share:

# grep vfs /var/log/samba/log.192.168.70.14
[2022/10/11 09:41:52.773645, 10, pid=3910, effective(11202, 10513), 
real(11202, 0)] 
../source3/modules/vfs_shadow_copy2.c:242(shadow_copy2_strip_snapshot)
   ../source3/modules/vfs_shadow_copy2.c:242: enter path 'rete'
[2022/10/11 09:41:52.773756, 10, pid=3910, effective(11202, 10513), 
real(11202, 0)] 
../source3/modules/vfs_shadow_copy2.c:242(shadow_copy2_strip_snapshot)
   ../source3/modules/vfs_shadow_copy2.c:242: enter path 'rete'
[2022/10/11 09:41:52.779978, 10, pid=3910, effective(11202, 10513), 
real(11202, 0)] 
../source3/modules/vfs_shadow_copy2.c:242(shadow_copy2_strip_snapshot)
   ../source3/modules/vfs_shadow_copy2.c:242: enter path 'rete'
[2022/10/11 09:41:52.780076, 10, pid=3910, effective(11202, 10513), 
real(11202, 0)] 
../source3/modules/vfs_shadow_copy2.c:242(shadow_copy2_strip_snapshot)
   ../source3/modules/vfs_shadow_copy2.c:242: enter path 'rete'
[2022/10/11 09:41:52.893172, 10, pid=3910, effective(11202, 10513), 
real(11202, 0)] 
../source3/modules/vfs_shadow_copy2.c:242(shadow_copy2_strip_snapshot)
   ../source3/modules/vfs_shadow_copy2.c:242: enter path '.'
[2022/10/11 09:41:52.893264, 10, pid=3910, effective(11202, 10513), 
real(11202, 0)] 
../source3/modules/vfs_shadow_copy2.c:242(shadow_copy2_strip_snapshot)
   ../source3/modules/vfs_shadow_copy2.c:242: enter path '.'
[2022/10/11 09:41:52.904518, 10, pid=3910, effective(11202, 10513), 
real(11202, 0)] 
../source3/modules/vfs_shadow_copy2.c:242(shadow_copy2_strip_snapshot)
   ../source3/modules/vfs_shadow_copy2.c:242: enter path '.'
[2022/10/11 09:41:52.904612, 10, pid=3910, effective(11202, 10513), 
real(11202, 0)] 
../source3/modules/vfs_shadow_copy2.c:242(shadow_copy2_strip_snapshot)
   ../source3/modules/vfs_shadow_copy2.c:242: enter path '.'

In your opinion I wrong some params in smb.conf or rsync snaphot can't 
be used as shadow copy?

Piviul




More information about the samba mailing list