Sticking something into the runlevel scripts
I'm not sure if they are even called that (runlevel scripts).
I'm trying to insert a script into the 'inittab' sequence, to rsync a folder to and from a location when I start up and shutdown linux. All it will do is on 'start' run the 'copy from' and on 'stop' run the 'copy to'
( I have to switch between my linux and windows partition pretty often. I'd just leave everything in the shared partition, if I didn't need linux permissions on the files.)
I understand that when the computer enters a runlevel, for example 2, it runs all the scripts in the folder /etc/r2.d/. I understand that it runs Ks first, in order, then S-s in order.
So knowing this: I'm going to stick the start script in rc2.d (running ubuntu) closer to S99 and I'm going to stick the stop script in rc0.d closer to k01.
This seems logical, but I'm only a week old on linux. I also want to make sure there isn't an easier way to run a script on shutdown. (start up you can use sessions I know)