I am trying to change
/var/log directory to symbolic link.
/var/log exists, I tried as below.
# cd /var # mv log log.bk (1) # ln -snf /path/to/somewhere/var/log log (2)
This way does not work well because a new
/var/log directory is created between
(2) ( I guess some system daemon creates it ), the symbolic link is created inside
# ls -l /var/log : lrwxrwxrwx 1 root root 23 Sep 2 13:27 log -> /path/to/somewhere/var/log -rw-r----- 1 root adm 38028 Sep 2 13:51 messages :
My expecting is as below.
# ls -l /var : lrwxrwxrwx 1 root root 23 Sep 2 13:27 log -> /path/to/somewhere/var/log drwxr-xr-x 8 root root 1680 Sep 2 06:25 log.bk :
How can I do this?