Placing a backup command in the shutdown process
I wrote a script file (based on rsync) to backup data into a usb memory stick. I intend for the backup to occur during shutdown of the system -part of it- , The computer is for home use and switched on daily for different lengths of time. The OS is Fedora 8.
Using cron is not suitable because the machine is not switched on 24/7.
With anacron I couldn't find a way to time the execution of the script just before shutdown when most of changes to the data have happened. in other words, I do not want the backup to happen after (m) minutes delay since switching on of the computer.
The intention is to make the back up part of the normal process of Fedora 8 shutdown i.e. like modified shutdown process.
Therefore, the goal is to insert the command ($ bash backup_script) in one of the files that get executed during system shutdown, so when the user click on switch off button and the process of shutdown begins, the backup command get executed at probably the start of shutdown and when it finishes, the shutdown process carry on as usual.
The question is in which file i should put the command ($ bash backup_script)?
Thanks in anticipation
you could create a backup script and place it in /etc/rc.d/init.d/ and then link to it in /etc/rc.d/rc0.d/ and /etc/rc.d/rc6.d/ so that it is called before the killall script (S00killall) so it would need to be alphabetically before killall so you could name the link something like S00a_mybackup. Then once the execution of your backup script completes the process will continue with S00killall and then either S01halt or S01reboot. This would likely be a more preferable method vs. sticking it in the halt initscript but if you must place it in the file vs. creating its own then the file you are seeking is /etc/rc.d/init.d/halt.
Thanks for the info buddy!
LQ Rocks ...
wow, i did not realize how poorly written my post was...
so... so ... so ... so... so i have no idea what i was thinking when i was writing that but i should definitely have read it for clarity before posting. note to self: anytime you type so use a period instead. sheesh! ;)
I'm glad someone found some use from my post even if it was vieing for title of longest runon sentence.
|All times are GMT -5. The time now is 01:34 AM.|