I will also talk about invalid characters in names and how ADM handle it. A must read for non-Windows users.
Setup rsync Server on Asustor
Enable Enable Rsync server on [Services] → [Rsync Server] tab and click [Apply].
Next, add a backup module which controls destination path and authentication in [Backup Modules] on the same tab. The Name will show up in TS-119P II and files will be copy to Path here.
If you want to authorize by account, create new users by [Manage Users] dialog. Click [Edit] on the back module. When you enable Authentication in [Backup Module] dialog, select them for this backup module.
Setup a Replication Job on QNAP
Open [Backup Station] → [Remote Replication] → [Rsync (File-Level Backup)] tab and click on [Create a Replication Job] to create a replication job.
In [Remote Replication] dialog, give it a name and click on [Settings] to setup Remote site. In [Settings] dialog, enter the IP and user of AS-5102T. If you didn’t enable Authentication in rsync server, provide any ADM valid user who has read and write access. Otherwise, provide authorized user in the backup module mentioned in previous section. The [Test] button only verifies if the give IP has a live rsync server. It doesn’t do anything with authentication.
If the authentication is success, you may select the backup module name in rsync server in Destination folder. Put the TS-119P II source folder in Source folder. Click on [Add] to confirm. You cannot only one pair of them in a replication job. If you need more folders to replicate, create a separate job for each of them.
Push the start icon next to the job in the tab to run this replication job immediately. If you want to run it regularly, click on [Backup frequency] button in [Remote Replication] dialog to schedule.
For files and folders already exist in destination path will be untouched unless there is the same file name from source. The file on destination will be replaced by file with the same name.
Invalid Characters in Names
When I am comparing contents on both sides, I notice a folder * Test on source becomes _3AJDB~3 on destination on OSX. The former is accessible but the later is not from OSX. Strangely, it is displayed properly in [File Explorer] in ADM. Moving files inside the folder without problems but fail to change name by warning containing invalid characters.
Anyway, it’s too wordy. Just take a look at the summary table.
|Folders contains invalid characters created on QTS from OSX
||QTS||rsync from QTS on ADM||QTS remote access from OSX||ADM remote access from OSX|
|Rename but keep invalid characters
||Fail||Fail||Success and display correctly on QTS||Success but display incorrectly on ADM|
I think it is ADM who force to follow the rules explained in NTFS and ReFS Invalid Characters section in Invalid Characters in File Names on its ext4. It’s a good idea for Windows users but a potential problem to others – QTS keeps them while ADM won’t. They will be replaced by characters known by ADM but not QTS or OSX. It’s call mangling.
Why Mangling and How To Stop
8 days after this post being published and more tests have been done, I finally realized I made a big mistake!
Samba still has to remain backwards compatible with network clients who store files only in the 8.3 format, such as Windows for Workgroups. If a user creates a file on a share called antidisestablishmentarianism.txt, a Windows for Workgroups client couldn’t tell it apart from another file in the same directory called antidisease.txt. Like Windows 95/98 and Windows NT, Samba has to employ a special methodology of translating a long filename to an 8.3 filename in such a way that similar filenames will not cause collisions. This is called name mangling, and Samba deals with this in a manner that is similar, but not identical to, Windows 95 and its successors.
Although I have enable Enable Mac file service (AFP) in [Services] → [Mac OS X] → [File Service] tab, it is Samba displayed in Finder.I am using it to access ADM shared folders. That’s why my file names with Windows invalid characters are mangled.
There are two solutions: add mangled names = no in smb.conf or use AFP (Apple Filing Protocol) instead.
Fail to Stop Samba Mangling
In Special characters in Samba filenames on serverfault, we may add mangled names = no in [global] section to stop mangling in Linux.
Windows does not allow some characters in filenames that Unix does allow. Samba “mangles” the filenames to make them comply with Windows restrictions…
Adding “mangled names = no” to smb.conf solved this (thanks, Dennis Williamson).
But even you modify /volume0/usr/builtin/etc/samba/smb.conf and restart with [Services] → [Windows], it won’t work. Samba keep on mangling Windows invalid characters. It’s the same if you modify /etc/config/smb.conf in QTS. mangled names is always yes on both systems.
We have to try next solution.
BTW, if you put # in front of any options, they will be removed after Samba restarts.
Show AFP Servers in Finder
To display an AFP server on ADM in Finder, enable Advertise AFP service over Bonjour in [Services] → [Mac OS X] → [File Service] tab and give it a service name. It will be displayed with (AFP) after service name in Finder.
- Apple: Apple Filing Protocol Concepts
- Apple: OS X
- Asustor: AS-5102T
- Asustor: ADM 2.7
- Asustor ADM Configuration and Executable Files
- Invalid Characters in File Names
- O’Reilly: Using Samba: 5.4 Name Mangling and Case
- QNAP QTS Configuration and Executable Files
- QNAP: Downloads and other support for TS-119P II
- QNAP: QTS
- serverfault: Special characters in Samba filenames
- Wiki: ext4
- Wiki: File Transfer Protocol
- Wiki: mount (Unix)
- Wiki: rsync