views:

265

answers:

1

I was thinking of using inotifywait to watch the original folder where the original folders are in, then when ever it detects that a folder has been deleted, then delete the same symbolic link in the other folder.

So my question is, is that the best way? Or are there better ways to delete a symbolic link when the original folder gets deleted?

+1  A: 

i have not used inotify, but if it can integrate *nix's find command, you can use it to delete the link

find /folderpath -type l -delete
ghostdog74