Hi polikuo,
Who is going to run the script ?
root / tc
Anyone. Whoever is easier to accomplish.
I've been telling you, you need to specify who will be running script.
Whenever you run sudo as root, nothing happens.
note: if I run thescript.sh manually after the prompt (eg. tc@box$)
It will create details.csv
I can see obviously now the answer is tc instead of root.
Anything under /usr/local/tce.installed is executed as root WHEN an extension is loaded.
Plus that script would only be executed once.
If you log out and log in again, nothing happens.
If you're happy with that, then change the content of your /usr/local/tce.installed/mytcz to something like:
#!/bin/sh
su tc -c 'thescript.sh'
When should it executes ?
every time you boot / every time you log-in / every time you load the extension
Every time I boot. And it also need to store a csv/text file automatically.
Since you want that interactive tcz to run onboot, I suggest you put that tcz at the end of your onboot.lst to avoid messing up the booting process.
I don't quite understand what backup should I make.
I read the book many hours back and forth before I attempted to do this. I learn a lot from the book and I also don't understand a lot from it
Therefore I seek interactive help from others in this forum. Because for sure I must have missed something from the book.
I'm hoping someone can point me out the things that I've missed / did not understand.
Tiny Core is a very unique distro.
By default, most directory are stored in RAM which will vaporize upon every reboot.
We backup those files before shutting down and restore those stuff every time we boot.