What's new

Config files in root home directory

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

pinklerose

New Around Here
Hi.

I have created a couple config files in /root directory (like .vimrc, .zshrc, etc) and they are working OK until router restart.
Is it any way to keep this files after reboot?
 
I added a line in post-mount jffs script to copy from my USB to /root


Sent from my iPhone using Tapatalk
 
I bet “set mouse-=a” is in your vimrc!? Drove me nuts not being able to copy/paste and was my motivation for the above solution.


Sent from my iPhone using Tapatalk
 
I bet “set mouse=a” is in your vimrc!? Drove me nuts not being able to copy/paste and was my motivation for the above solution.
No mate. I have syntax and line numbers. Didn't know that one but might consider to add it. ;)
 
  • Like
Reactions: JDB
So "cp -a /my/files/location/. /root/" results:
cp: write error: No space left on device
cp: out of memory

I am not sure why...
 
I saved the file on USB without the leading dot so my cmd is;
cp /path/to/files/vimrc /root/.vimrc

Annoying to have to do one file at a time but if it works... I’m also ssh’ing as admin user, not sure if it’s a permission thing based on your user? And I’m not using the -a switch.
Only other thing to try is I would have thought to do all hidden files you’d need /.*


Sent from my iPhone using Tapatalk
 
Are these static files? Why not just leave them in /jffs then reference them directly?

Can save them in jffs if you want. But you still need to put them in /root at boot make them effective on SSH login.


Sent from my iPhone using Tapatalk
 
I see. In that case why not use ln to make links in /root to them. You'd benefit by only needing to modify them in one place for the changes to be reflected elsewhere. Performance wise, I doubt there'd be much difference between copying and linking.
 
That would also work


Sent from my iPhone using Tapatalk
 
I see. In that case why not use ln to make links in /root to them. You'd benefit by only needing to modify them in one place for the changes to be reflected elsewhere. Performance wise, I doubt there'd be much difference between copying and linking.

I will try to do that.
 
Creating symbolic links does not cause any problems.
Just to double check before I'll do something wrong. Is that correct way to create post-mount script?

#!/bin/sh

if [ "$1" = "/tmp/mnt/SanDisk" ] ; then
ln -nsf $1/entware /tmp/opt
ln -s /tmp/mnt/file/location/.vimrc /tmp/root/.vimrc
fi

Or should it be below fi?
 
Assuming the files are on your USB then yes leave it in the if

And again if it is on the USB I would do it the same as the opt example and use $1 as the start of the path

If you put the files in jffs I’d put the line in services-start script instead.


Sent from my iPhone using Tapatalk
 

Similar threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top