[Samba] Smbclient With Tarmode and Excludes
Christian Völker
cvoelker at knebb.de
Thu Aug 21 10:13:50 MDT 2014
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi all,
I just noticed a strange behavious of my smbclient which came up on
debugging BackupPC.
I have set up a AD Domain with an windows Server as DC. In this domain I
have a laptop running which I try to backup.
On the laptop I created a share called "C" and assigned access
permissions for the user called "backuppc".
I want to exclude some directories and files from the backup so I use
excludes. Initially I was unsure about the syntax and I found a bug
report to this:
https://bugzilla.samba.org/show_bug.cgi?id=4734
Now I used the following command line to perform the backup:
smbclient \\\\christian.knebb.de\\C "xxxxx" -U backuppc -E -d 2 -c
tarmode\ full -TcrX - "\Apps" >/bu.tar
In contrast to the above mentioned bug report smbclient does *NOT*
exclude the directories! I have to use wildcards to get this:
smbclient \\\\christian.knebb.de\\C "xxxxx" -U backuppc -E -d 2 -c
tarmode\ full -TcrX - "\Apps\*" >/bu.tar
Now I tried to exclude a single file from backup as follows:
smbclient \\\\christian.knebb.de\\C "xxxxx" -U backuppc -E -d 2 -c
tarmode\ full -TcrX - "\Apps\*" "\hiberfil.sys" >/bu.tar
Unfortunately smbclient always tries to backup the file- which is
obviously always locked and thus smbclient aborts:
[...]
NT_STATUS_SHARING_VIOLATION opening remote file \hiberfil.sys (\)
NT_STATUS_SHARING_VIOLATION listing \\*
tar: dumped 84 files and directories
Total bytes written: 12719104
My questions:
1. What is the correct syntax to exclude a single file?
2. Will someone possibly reopen the above bug and document the correct
usage (with asterix) for directories?
3. Is there a way to tell smbclient to skip the file in case of error
instead of aborting?
FYI:
Tested on CentOS5/32 (samba 3.6.6) and CentOS6/64 (samba 3.6.9)
smb.conf:
[global]
workgroup = MYDOMAIN
server string = Samba Server Version %v
unix charset = UTF8
password server = 10.1.1.20
realm = LOCAL.MYDOMAIN.DE
security = ADS
encrypt passwords = yes
winbind use default domain = true
load printers = yes
cups options = raw
[homes]
comment = Home Directories
browseable = no
writable = yes
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
Any clue?
Greetings
Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
iEYEARECAAYFAlP2Gr4ACgkQ0XNIYlAXmztZegCeIWxztDd4eNEF7Cl9gDN+WXq6
FfQAnjSzxH/iE54IEiUIDoAIKD3M7qft
=3UKF
-----END PGP SIGNATURE-----
More information about the samba
mailing list