Help With Hard links And Symlinks Moving Directory And Files

Posted by Julio on Ask Ubuntu See other posts from Ask Ubuntu or by Julio
Published on 2012-12-20T11:09:34Z Indexed on 2012/12/20 11:13 UTC
Read the original article Hit count: 411

Filed under:
|
|

This is what I would like to do. I have a symlink "/var" linking to "/tmpfs/var.1"

/var -> /tmpfs/var.1

I start a script called "cache_tmpfs" from /etc/rc.local on startup

this script will copy /var.backup/* contents to /tmpfs/var.1/

cp -dpRxf /var.backup/* /tmpfs/var.1/

now the problem is that kernel is opening messages log file in /var/log/messages, is it possible to remove the current /var symlink and recreate a new one (that will symlink to /var.backup insteed of /tmpfs/var.1) without issues as files once opened by system become hard links??

rm /var && ln -s /var.backup /var

Thanks...

© Ask Ubuntu or respective owner

Related posts about symbolic-link

Related posts about tmpfs