Bernhardt Eckl
2018-Aug-15 09:13 UTC
[Samba] vfs_shadow_copy2 with snapprefix & delimiter options
Hello all, I already successfully configured shadow copy service without a delimiter and regex. But as soon as I try to get this to work with regex, nothing shows up on the win client. My config looks like this: [global] shadow: localtime = yes shadow: sort = desc shadow: format = _%FT%T shadow: delimiter = _ shadow: snapprefix = ^\(monthly\)\{0,1\}\(weekly\)\{0,1\}\(daily\)\{0,1\}$ [someshare] path = /mnt/share/User hide dot files = No follow symlinks = Yes wide links = Yes vfs objects = shadow_copy2 shadow: mountpoint = /mnt/share shadow: snapdir = .zfs/snapshot shadow: snapsharepath = User The content of snapshot folder: root:/tmp# ll /mnt/share/.zfs/snapshot/ drwxrwxrwx 2 root root 2 Aug 15 06:25 . drwxrwxrwx 1 root root 0 Aug 7 17:17 .. drwxr-xr-x 5 root root 5 Jun 4 19:46 daily_2018-08-09T06:25:08 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-10T06:25:09 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-11T06:25:08 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-12T06:25:08 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-13T06:25:07 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-14T06:25:09 drwxrwxrwx 1 root root 0 Aug 15 09:16 daily_2018-08-15T06:25:08 drwxrwxrwx 1 root root 0 Aug 14 12:01 monthly_2018-07-01T06:52:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 monthly_2018-08-01T06:52:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 weekly_2018-07-22T06:47:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 weekly_2018-07-29T06:47:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 weekly_2018-08-05T06:47:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 weekly_2018-08-12T06:47:01 As I already told, if I use the same setup without delimiter/snapprefix and a fixed daily/weekly/monthly format string, then it is working: shadow: format = weekly_%FT%T Now at this point I have no clue if its really a config failure, or a bug. Log says its successfully parsing the snapshots: [2018/08/14 19:07:03.235339, 6, pid=21709, effective(1000, 1000), real(1000, 0)] ../source3/modules/vfs_shadow_copy2.c:2131(shadow_copy2_get_shadow_copy_data) shadow_copy2_get_shadow_copy_data: daily_2018-08-13T06:25:07 -> @GMT-2018.08.13-04.25.07 [2018/08/14 19:07:03.235394, 10, pid=21709, effective(1000, 1000), real(1000, 0), class=vfs] ../source3/modules/vfs_default.c:1412(vfswrap_fsctl) FSCTL_GET_SHADOW_COPY_DATA: 13 volumes for path[folder/file.txt]. Label[0]: '@GMT-2018.08.14-04.25.09' Label[1]: '@GMT-2018.08.13-04.25.07' Label[2]: '@GMT-2018.08.12-04.47.01' Label[3]: '@GMT-2018.08.12-04.25.08' Label[4]: '@GMT-2018.08.11-04.25.08' Label[5]: '@GMT-2018.08.10-04.25.09' Label[6]: '@GMT-2018.08.09-04.25.08' Label[7]: '@GMT-2018.08.08-04.25.08' Label[8]: '@GMT-2018.08.05-04.47.01' Label[9]: '@GMT-2018.08.01-04.52.01' Label[10]: '@GMT-2018.07.29-04.47.01' Label[11]: '@GMT-2018.07.22-04.47.01' Label[12]: '@GMT-2018.07.01-04.52.01' But then later I see this: [2018/08/14 19:07:03.256940, 10, pid=21709, effective(1000, 1000), real(1000, 0)] ../source3/smbd/filename.c:1209(unix_convert) dirpath = [] start = [@GMT-2018.08.01-04.52.01/folder/file.txt] [2018/08/14 19:07:03.256956, 10, pid=21709, effective(1000, 1000), real(1000, 0)] ../source3/smbd/filename.c:1624(filename_convert_internal) filename_convert_internal: unix_convert failed for name folder/file.txt/@GMT-2018.08.01-04.52.01 with NT_STATUS_OBJECT_PATH_NOT_FOUND [2018/08/14 19:07:03.256978, 3, pid=21709, effective(1000, 1000), real(1000, 0), class=smb2] ../source3/smbd/smb2_server.c:3171(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_OBJECT_PATH_NOT_FOUND] || at ../source3/smbd/smb2_create.c:296 And the windows client ends up with an empty list. Samba version I tried so far: 4.8.2+dfsg-2 (Debian testing) and current master of the git repository (Debian patches applied). Hope someone has an idea what could be wrong here. Thanks already in advance. BR, Berd
Bernhardt Eckl
2018-Aug-15 09:58 UTC
[Samba] vfs_shadow_copy2 with snapprefix & delimiter options
Hi, I made some progress in the meantime.. If I change the times to UTC/GMT (localtime = no) then it is working. Does this make sense? If thats really how it should work, then docs needs to be updated, please. BR. ________________________________ Von: samba <samba-bounces at lists.samba.org> im Auftrag von Bernhardt Eckl via samba <samba at lists.samba.org> Gesendet: Mittwoch, 15. August 2018 11:13:13 An: samba at lists.samba.org Betreff: [Samba] vfs_shadow_copy2 with snapprefix & delimiter options Hello all, I already successfully configured shadow copy service without a delimiter and regex. But as soon as I try to get this to work with regex, nothing shows up on the win client. My config looks like this: [global] shadow: localtime = yes shadow: sort = desc shadow: format = _%FT%T shadow: delimiter = _ shadow: snapprefix = ^\(monthly\)\{0,1\}\(weekly\)\{0,1\}\(daily\)\{0,1\}$ [someshare] path = /mnt/share/User hide dot files = No follow symlinks = Yes wide links = Yes vfs objects = shadow_copy2 shadow: mountpoint = /mnt/share shadow: snapdir = .zfs/snapshot shadow: snapsharepath = User The content of snapshot folder: root:/tmp# ll /mnt/share/.zfs/snapshot/ drwxrwxrwx 2 root root 2 Aug 15 06:25 . drwxrwxrwx 1 root root 0 Aug 7 17:17 .. drwxr-xr-x 5 root root 5 Jun 4 19:46 daily_2018-08-09T06:25:08 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-10T06:25:09 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-11T06:25:08 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-12T06:25:08 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-13T06:25:07 drwxrwxrwx 1 root root 0 Aug 14 12:01 daily_2018-08-14T06:25:09 drwxrwxrwx 1 root root 0 Aug 15 09:16 daily_2018-08-15T06:25:08 drwxrwxrwx 1 root root 0 Aug 14 12:01 monthly_2018-07-01T06:52:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 monthly_2018-08-01T06:52:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 weekly_2018-07-22T06:47:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 weekly_2018-07-29T06:47:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 weekly_2018-08-05T06:47:01 drwxrwxrwx 1 root root 0 Aug 14 12:01 weekly_2018-08-12T06:47:01 As I already told, if I use the same setup without delimiter/snapprefix and a fixed daily/weekly/monthly format string, then it is working: shadow: format = weekly_%FT%T Now at this point I have no clue if its really a config failure, or a bug. Log says its successfully parsing the snapshots: [2018/08/14 19:07:03.235339, 6, pid=21709, effective(1000, 1000), real(1000, 0)] ../source3/modules/vfs_shadow_copy2.c:2131(shadow_copy2_get_shadow_copy_data) shadow_copy2_get_shadow_copy_data: daily_2018-08-13T06:25:07 -> @GMT-2018.08.13-04.25.07 [2018/08/14 19:07:03.235394, 10, pid=21709, effective(1000, 1000), real(1000, 0), class=vfs] ../source3/modules/vfs_default.c:1412(vfswrap_fsctl) FSCTL_GET_SHADOW_COPY_DATA: 13 volumes for path[folder/file.txt]. Label[0]: '@GMT-2018.08.14-04.25.09' Label[1]: '@GMT-2018.08.13-04.25.07' Label[2]: '@GMT-2018.08.12-04.47.01' Label[3]: '@GMT-2018.08.12-04.25.08' Label[4]: '@GMT-2018.08.11-04.25.08' Label[5]: '@GMT-2018.08.10-04.25.09' Label[6]: '@GMT-2018.08.09-04.25.08' Label[7]: '@GMT-2018.08.08-04.25.08' Label[8]: '@GMT-2018.08.05-04.47.01' Label[9]: '@GMT-2018.08.01-04.52.01' Label[10]: '@GMT-2018.07.29-04.47.01' Label[11]: '@GMT-2018.07.22-04.47.01' Label[12]: '@GMT-2018.07.01-04.52.01' But then later I see this: [2018/08/14 19:07:03.256940, 10, pid=21709, effective(1000, 1000), real(1000, 0)] ../source3/smbd/filename.c:1209(unix_convert) dirpath = [] start = [@GMT-2018.08.01-04.52.01/folder/file.txt] [2018/08/14 19:07:03.256956, 10, pid=21709, effective(1000, 1000), real(1000, 0)] ../source3/smbd/filename.c:1624(filename_convert_internal) filename_convert_internal: unix_convert failed for name folder/file.txt/@GMT-2018.08.01-04.52.01 with NT_STATUS_OBJECT_PATH_NOT_FOUND [2018/08/14 19:07:03.256978, 3, pid=21709, effective(1000, 1000), real(1000, 0), class=smb2] ../source3/smbd/smb2_server.c:3171(smbd_smb2_request_error_ex) smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_OBJECT_PATH_NOT_FOUND] || at ../source3/smbd/smb2_create.c:296 And the windows client ends up with an empty list. Samba version I tried so far: 4.8.2+dfsg-2 (Debian testing) and current master of the git repository (Debian patches applied). Hope someone has an idea what could be wrong here. Thanks already in advance. BR, Berd -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/options/samba
Apparently Analagous Threads
- vfs_shadow_copy2 with snapprefix & delimiter options in samba 4.6.2
- vfs_shadow_copy2 with snapprefix & delimiter options in samba 4.6.2
- vfs_shadow_copy2 with snapprefix & delimiter options in samba 4.6.2
- vfs_shadow_copy2 with snapprefix & delimiter options in samba 4.6.2
- vfs_shadow_copy2 not working