So I took your .txt file and edited it as I thought proper.
after I had finished, saved and put it in the folder of my choice on my NAS, I run "chmod a+x myscriptname.txt" via Putty (skipped sudo, as I had logged in as admin and there were no sudo installed).
and then launched, as said "./myscriptname.txt".
At this point it gave me an error "/bin/bash^M: bad interpreter: No such file or directory". After some quick googling I guess I found out the reason for this mistake - I took your .txt file and edited it in Notepad on my Win7 machine. Turns out, it is not good for Linux (I told you I am a total nooby ). So as I read - in order to fix the file I have to run "dos2unix" to fix the file. So I run "dos2unix myscriptname.txt" and it sort of fixed the previous error, but I am afraid, it broke the file in some other way (or it was not correct the way I built it). As when i run it, for each line it gave smth like this:
Code: Select all
Creating Links in /share/HDA_DATA/SymLinks/Sci-Fi for everything found in folder: /share/HDA_DATA/Multimedia/!Movies/Sci-Fi
BusyBox v1.01 (2011.08.03-17:58+0000) multi-call binary
Usage: find [PATH...] [EXPRESSION]
Search for files in a directory hierarchy. The default PATH is
the current directory; default EXPRESSION is '-print'
EXPRESSION may consist of:
-follow Dereference symbolic links.
-name PATTERN File name (leading directories removed) matches PATTERN.
-print Print (default and assumed).
-type X Filetype matches X (where X is one of: f,d,l,b,c,...)
-perm PERMS Permissions match any of (+NNN); all of (-NNN);
or exactly (NNN)
-mtime TIME Modified time is greater than (+N); less than (-N);
or exactly (N) days
I attach both the files - one before running dos2unix (1.txt) and the other - after (2.txt). Can you pls tell me, what is the problem there?
Also few additional questions:
1) how to find what is the path from my Linux NAS to Windows Workstation (in the same network) -
for putting it in createsymlinks file?
2) what happens if from two different Sourcefolders there are two subfolders with the same name -
how will they be displayed in Destfolder? Their contents will simply merge? What if there are file names
with the same names?
3) what's the simplest and the correct way to delete all symlinks?