Please reference the bash code example of syncing folders from one drive to another under WSL here:
https://github.com/jasonmccb/myWSLSync.git
- USB disk needs to be mounted MANUALLY from time to time
sudo mkdir /mnt/e sudo mount -t drvfs E: /mnt/e sudo umount /mnt/e
-
WSL may not be able to read correct permissions from time to time
Below screenshot shows different results of running same command between a few secondsSolution:
Manually add permission to such folders/files.sudo chmod a+r,a+x folder1 file1 sudo chmod -R 777 folder2 #-R for recursion
-
File or folder name can contain % symbol
This can be a problem to some commands such asfind . -printf "$fileName=%f\n"
.
When bash expands $fileName, it may considers %xxx as a directive.Solution:
Use %% as % in variable for the “find -printf”.