Home / Server side scripting / Linux / Start programs or scripts at system bootup

Start programs or scripts at system bootup

The script /etc/rc.local is to be used by the systems administrator. It is executed after all the normal system services has been started. Administrators can use it to get the summary of the server(like memory status, hardware status, and others). The reports can be sent to personal mail ID. The following is an entry inside the /etc/rc.local file:

# vi /etc/rc.local
‘echo last’ | /bin/mailx –s “Last Logged-in users in system “ user@gmail.com

Save the file by presenting :wq!

Next time, when the server boots, a mail will be thrown with the report of the last logged-in user’s information- the same way programs or scripts can be placed inside /etc/rc.local, as shown below.

Here’s a program example:

/opt/Tivoli/tsm/client/ba/bin/dsmc sched > /dev/null 2>&1 &

This is used to start the TSM( Tivoli storage manager) client to run a backup.

Leave a Reply

Your email address will not be published. Required fields are marked *

Social Media Auto Publish Powered By : XYZScripts.com