4

I am using a NAS(synology/xpenology) currently with 1 Drive /volume1/Drive is the share. I have other shares on this Drive /volume1/Drive/SeriesPC its a share connected to my drive on my pc.

Now I want to symlink every directory from SeriesPC to the Show folders on /volume1/Drive/Series

example:

Inside /volume1/Drive/Series

  • The 100
  • NCIS
  • NCIS La
  • NCIS New Orleans

and inside /volume1/Drive/SeriesPC

  • 24
  • Alias
  • The Blacklist
  • Under the Dome

now I want it like this

Inside /volume1/Drive/Series

  • The 100
  • NCIS
  • NCIS La
  • NCIS New Orleans
  • 24 > /volume1/Drive/SeriesPC/24
  • Alias > /volume1/Drive/SeriesPC/Alias
  • The Blacklist > /volume1/Drive/SeriesPC/The Blacklist
  • Under the Dome > /volume1/Drive/SeriesPC/Under the Dome

This without needing to create 24/Alias/The Blacklist/Under the Dome directories manually

So every directory inside SeriesPC must get symlinked to Series

I hope I am here right and explained it good enough

1
  • note: I tried ln -s /volume1/Drive/SeriesPC/* /volume1/Drive/Series but it creates files that cant be accessed I also used the "find" comment I found here aswell but it said unsupportive operation
    – Brian
    Oct 29, 2014 at 11:26

2 Answers 2

3

This should do it:

cd /volume1/Drive/Series
ln -s ../SeriesPC/* .
1
  • Thnxs. Tryed something like that before but withouth the . Works aswell ty:)
    – Brian
    Oct 29, 2014 at 13:27
1

I would do the following if you want all the files/directories under SeriesPC to be linked:

cd /volume1/Drive/SeriesPC
for i in * ; do ln -s "$PWD/$i" /volume1/Drive/Series/ ; done

If not everything under SeriesPC should be linked make sure you can find just the directories that you need e.g. using find * -maxdepth 1 -type d and then do:

cd /volume1/Drive/SeriesPC
find * -maxdepth 1 -type d -exec ln -s $PWD/{} /volume1/Drive/Series/ \;
8
  • It doesn't recognize the -t option. Not certain its because of the busybox version or something else? it only gives as option -s/f/n/b/S
    – Brian
    Oct 29, 2014 at 12:36
  • @db3 you can also do ln -s $PWD/24 /volume1/Drive/Series/
    – Anthon
    Oct 29, 2014 at 13:02
  • Thnxs that works. Guess the only way to do it is to manually enter every directory unless -t gets working somehow
    – Brian
    Oct 29, 2014 at 13:13
  • You can replace the explicit reference to 24 with $i as in my answer, just change the -t /volume1/Drive/Series/ {} to "$PWD/{} /volume1/Drive/Series/"
    – Anthon
    Oct 29, 2014 at 13:42
  • @db3 I updated the answer, it should now be cut and paste, without using the -t option for ln
    – Anthon
    Oct 29, 2014 at 13:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .