I have a scenario where I have a git repository that I do a git pull every x minutes, in the following dir: /opt/repo/
In this repository I have some directories like:
- /opt/repo/dir1
- /opt/repo/dir2
- /opt/repo/dir3
that are created on the repo dinamycally and retrieved in every git pull.
What I need to do is, after every git pull, create a symlink for those directories (only the new ones) on another path:
/var/www/themes/
Manually, what I do is the following:
$ cd /var/www/themes
$ ln -s /opt/repo/dir1 .
$ ln -s /opt/repo/dir2 .
$ ln -s /opt/repo/dir3 .
Is there a way to do that in every call? I don't want to recreate the existing symlinks, just create for the ones that doesn't exist yet.
====
SYN solution works, I just had to invert -maxdepth and type order (I was running it over Ubuntu 16 it that matters).