Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 instead of /tmpfs/var.1) without issues as files once opened by system become hard links??

rm /var && ln -s /var.backup /var
share|improve this question
Other than forcing those processes to close the file, change your /var directory and reopen it, I do not see a soultion to change your /var directory. However, what's your goal primary goal? Maybe you can archive it by simply copy the content, or using snapshot technologies (LVM/btrfs). –  falstaff Dec 20 '12 at 11:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.