04 66 72 51 22

A network drive or NAS share is not being backed up ("not found" or "inaccessible")

This page is intended for administrators who wish to back up a folder located on another computer, a file server or a NAS (Network Attached Storage), where the backup reports that folder as missing or inaccessible. It explains why a network drive visible in Windows Explorer is not visible to the agent, and how to declare a share correctly along with its credentials. It applies to the BeBackup agent for Windows.

Symptom

The backup report contains one of these lines:

  • Directory "…" cannot be found.
  • Directory "…" is inaccessible. Error … : … (the Windows error code and text follow)
  • Directory "…" is locked. The files it contains will not be backed up. (followed by the error code)
  • Access denied to directory "…", ending with Its contents are NOT backed up.
  • An error occurred while connecting to share "…" : error … (…).
  • Syntax error in the @Connect command
  • Computer or domain "…" not found for the @BackupShares command.

Often, the folder was selected under a network drive letter, for example Z:\Accounts, and it opens without any problem in Windows Explorer.

Cause

The agent runs as a Windows service, outside the user's session. A network drive (a letter such as Z:) is attached to the session of the user who connected it. The agent's service therefore cannot see it, and the folder appears to be missing.

Likewise, the credentials the user saved in Windows for that share are not the service's credentials. The agent must be given its own credentials in order to open the share.

The solution is to declare the share by its full network path, known as a UNC (Universal Naming Convention) path, for example \\server\share\folder, together with a user name and a password.

Checks

  1. Look at the path reported in the report. If it starts with a network drive letter, the cause is the one described above.
  2. From the workstation, check that the server can be reached by its name or its IP (Internet Protocol) address.
  3. Check that the account you intend to use has read access to the share. Test it from another workstation if necessary.
  4. If the message is Directory "…" is locked, it refers to a subfolder encountered during the scan: read the error code that follows. It usually indicates insufficient rights on that subfolder rather than an actual lock. A mistyped starting folder, on the other hand, produces Directory "…" cannot be found.

Resolution

Declaring the share in the web interface

  1. Open the agent configuration for the medium concerned. The agent must be connected to the server; otherwise, the interface rejects the change with a message beginning with Backup agent not connected: the source cannot be modified at this time.
  2. In the Network shares section, click Add a share.
  3. Fill in Server, User name and Password. For a domain account, use the format expected by your file server.
  4. Under Items to back up, choose:
    • Defined shares, then specify the folders and files to back up;
    • or All shares (hidden shares excluded), then enter an existing share in Share name, which is used to open the connection.
  5. Click Check to test the connection, then Save.

Enter the password in clear text. It is encrypted when the configuration is saved, and is no longer readable in the configuration afterwards.

Then remove from the selection any folders chosen under a network drive letter.

The format of the directives

In the agent configuration, a declared share takes the form of a directive. You will come across these in a configuration export. The web interface always places these directives and \\… paths in the Network shares section, never in Other commands:

@Connect \\server\share:user:password
@BackupShares \\server\share:user:password:IncludeHidden
  • @Connect opens the connection to the share. The folders to be backed up are then listed by their UNC path.
  • @BackupShares backs up all the shares on the server. Hidden shares, whose names end with $, are ignored unless you add :IncludeHidden.

Writing one of these directives by hand with a password that has not gone through the configuration save process produces the message Syntax error in the @Connect command. Use the Network shares form instead.

During the backup

If the connection to the share is lost during the backup, the agent attempts to reconnect using the declared credentials, then to read the file again. This reconnection only works for a share declared with its UNC path and its credentials. If it fails, the report contains a line beginning with An error occurred while reconnecting to share "…", followed by the error code.

On macOS and Linux

The @Connect directive does not apply. The report contains a warning beginning with The @Connect directive ("…") does not apply on this platform. Mount the share through the operating system, then add its mount point as an ordinary source.

If the problem persists

If the connection fails despite correct credentials, note the code that follows error in the message. This is the Windows error code for the connection. Contact BeBackup support with this code, the backup report and the agent service log, bbAgent-service.log.

BeBackup is backup built for IT service providers

Backup and restore of workstations, servers, virtual machines and Microsoft 365, encrypted at source with a key we do not hold, on the hosting of your choice.