Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have added some commands which are executed on startup by editing /etc/init.d/bootmisc.sh.
Now I want to add some commands to be executed on shutdown. How do I do this?
Specifically, I want to copy my .mail folder, my bookmarks folder and my addresses folder to a backup partition each time the computer is shut down. Then, about once a week (or perhaps every other week) I want to copy some other files to a backup location.
I have added some commands which are executed on startup by editing /etc/init.d/bootmisc.sh.
Now I want to add some commands to be executed on shutdown. How do I do this?
Specifically, I want to copy my .mail folder, my bookmarks folder and my addresses folder to a backup partition each time the computer is shut down. Then, about once a week (or perhaps every other week) I want to copy some other files to a backup location.
Thanks
Most distros use a rcX.d structure these days. Make your
shutdown script, and stick a symlink in rc0.d and rc6.d,
with a KXX-name ...
Debian is one of the distributions which use the rcX.d structure for init levels as Tinkster said. /etc/rc0.d contains symbolic links to scripts executed at halt and /etc/rc6.d contains scripts executed at reboot. Create your scripts someplace where you won't lose them when you do a reinstall and put symbolic links in /etc/rc0.d and /etc/rc6.d to your scripts.
The scripts in these folder are run in alphabetic order. You will need to put your scripts near or at the beginning. If you put them at the end the machine will halt or reboot without executing your scripts.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.