Scenario
I am on an embedded Linux system. As usual /var/log/
is the directory when all the logs are stored. I have a directory called /safepath
which is created during image creation and it is on persistent memory. It means that whatever I place under /safepath
persists across reboot sessions.
I want the logs in /var/log/
to not be lost on every reboot and wish to make it persistent through the reboots. So I thought to mount /var/log/
on to /persists
by doing a mount --bind /var/log /safepath
which I read from this interesting discussion here
Question:
But doing this still causes me to lose the data in /var/log/
. Is this correct? How can one force /var/log/
to persist across reboot sessions?
ln -snf
?ln -snf /var/log /safepath
complains :failed to create symbolic link '/safepath/log': Operation not permitted
! – TheWaterProgrammer Oct 24 '18 at 15:26