conditional symbolic link in Solaris 10

Hello World :slight_smile:

I want to create a conditional symbolic link in Solaris 10 so that if one destination becomes unavailable it should automatically point to another destination.

e.g. /dump/abc is destination.
/export/home/abc contains a copy of it

symbolic link should be /abc --> /dump/abc AND IF it's unavailable point to /export/home/abc

How can we do it in Solaris 10?

symbolic links are static, period.

This is a waste of cpu time but, add this to your root crontab

* * * * * /path/to/myscript.sh

myscript.sh:

[ -f /dump/abc ]  && exit
unlink  /dump/abc
ln -s /export/home/abc /dump/abc

Conditional symbolic links were part of some ancient unix flavors, like Sinix or Dynix in the early 90ies. The only condition they could implement was the universe a process was running in. Depending on that, the link pointed to different locations. But that is history now, conditional symbolic links are extinct.