smbclient NT_STATUS_ACCESS_DENIED on directories when Windows doesn't

Solution 1:

You are going to need to exclude each of the folders that are giving you errors. You need to do this as the files you getting errors on are junction points (like symlinks) and smbclient cannot handle accessing them in samba-3.6.* (from what I can tell).

I only want a limited backup of user data. So, the directive I am using in my [host].pl file is:

$Conf{BackupFilesExclude} = {
  '*' => [
    '\\\\$Recycle.Bin',
    '\\\\Documents and Settings',
    '\\\\MSOCache',
    '\\\\pagefile.sys',
    '\\\\PerfLogs',
    '\\\\Program Files (x86)',
    '\\\\Program Files',
    '\\\\ProgramData',
    '\\\\Recovery',
    '\\\\System Volume Information',
    '\\\\Windows',
    '\\Users\\\\All Users',
    '\\Users\\\\Default User',
    '\\Users*AppData',
    '\\Users*Application Data',
    '\\Users*Cookies',
    '\\Users*Documents\\\\My Music',
    '\\Users*Documents\\\\My Pictures',
    '\\Users*Documents\\\\My Videos',
    '\\Users*Local Settings',
    '\\Users*My Documents',
    '\\Users*NetHood',
    '\\Users*PrintHood',
    '\\Users*Recent',
    '\\Users*SendTo',
    '\\Users*Start Menu',
    '\\Users*Templates',
    '*NTUSER.DAT',
    '*ntuser.dat.LOG1',
    '*ntuser.dat.LOG2'
  ]
};

Also note that because of the file globbing certain directories listed above WILL NOT BE BACKED UP! This is not a problem for me as those directories do not contain any data I want included in my backup.

If I could work out a better way I would be much happier.