What can I do if I encounter a "Not a valid directory" error in HBS?
Applicable Products
Hybrid Backup Sync
Cause
In Hybrid Backup Sync (HBS), if you encounter the error message "Not a valid directory. Attempting to retry. Error code: -20" when running a backup job, this indicates that the source folder contains subfolders that have a space character at the end of the folder name (for example, "/source_folder/folder_name_with_space_at_the_end /").
Solution
In File Station, it is impossible to determine whether a folder name has trailing spaces just by looking at the name. The only way is to manually edit the folder name first. This is manageable if you only have a few subfolders. However, if there are too many subfolders, you can obtain a list of the affected subfolders via SSH first.
- Note the source folder path in the backup job.
- Open HBS 3 on the NAS.
- Go to Backup & Restore.
- Locate and click the backup job.
- Note the source path next to Source.
- Optional: Obtain the list of affected subfolders via SSH.
- Access the NAS via SSH on your computer.
For details, see How do I access my QNAP NAS using SSH? - Go to the source folder of the backup job by entering the following command.
# Replace "/Public/source_folder/" with your source folder path: cd /Public/source_folder/
- Obtain the list of subfolders that have a space at the end of the folder name.
find -name "* " -type d
- Access the NAS via SSH on your computer.
- Rename the affected subfolders.
- Open File Station on the NAS.
- Go to an affected subfolder.
- Right-click the subfolder and select Rename.
The Rename window opens. - Remove all spaces at the end of the name.
- Click OK.
- Repeat the above steps for each affected subfolder.
You can now run the backup job again.