Vimal Annamalai Vimal Annamalai - 1 year ago 97
Python Question

How to make the .sh file should be in running state always

I'm new to shell scripting, i want the command to be in running always.
My .sh file -

echo "Scrapyd is started now"

i have changed the permission also
chmod +x etc/init.d/

I have placed this file in etc/init.d but it is not working.
My understanding as of now " the location
is to run the .sh files
whenever the server or system boots up but i want my .sh file to be running state always.

Answer Source

Using crontab you can easily auto start any scripts in ubuntu.
Please do the following steps,

  1. Run the command crontab -e so that you can edit the crontab.
  2. Now add the following line to the crontab editor @reboot sudo <script> in your case it should be @reboot sudo scrapyd.
  3. Now reboot your system, then you will find scrapyd running.

Hope it Helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download