Sometimes, after performing VPS migrations, the soft links in /etc/vz/conf may not be removed. Over time, the dead links may build up and cause many ‘No such file or directory’ messages when trying to look for common settings amonst all conf files (ie cat /etc/vz/conf/*.conf | grep whatever).
Quick easy way to delete these dead links:
~# cd /etc/vz/conf
~# for f in `find . -type l ! -exec test -r {} \; -print`; do rm -f $f; done
One liner:
~# find -L -type l -exec rm -f {} \;
* Please test before issuing these commands on production systems!!
Recent Comments