Koozali.org: home of the SME Server

autostart .sh program at system boot.

Offline tropicalview

  • *****
  • 196
  • +0/-0
    • http://www.tropicalview.net
autostart .sh program at system boot.
« on: September 10, 2009, 09:04:38 PM »
Dear all,

I created a .sh "program" that will allert if the backup devices are not in place.
how can i place /home/e-smith/files/ibays/contribs/files/clean-backup/clean-backup.sh so that it will be submitted  to the background at system bootup (the script it self will sleep each day.

« Last Edit: September 10, 2009, 09:28:17 PM by tropicalview »
The sky is not the limit, But when I reach the sky, for sure I will not try to go to the limit.... (donated $25,- upto now)

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: autostart .sh program at system boot.
« Reply #1 on: September 10, 2009, 09:40:19 PM »
you could call it in /etc/rc.d/rc.local: simply add /home/e-smith/files/ibays/contribs/files/clean-backup/clean-backup.sh at the end of file..

just a question.. why don't you use cron?

Stefano

Offline tropicalview

  • *****
  • 196
  • +0/-0
    • http://www.tropicalview.net
Re: autostart .sh program at system boot.
« Reply #2 on: September 11, 2009, 12:18:32 AM »
Hi Stefano a.k.a. nenonano ,

Thank you for the answer,
well i created a .sh program that will do all the jobs i want to be executed, and now it's flexible for me to addapt whatever i want.

I did try with cron before i started creating this little program, but i did not understand how exactly.
after all this was easier for me. (i know this is not like the standards as SME uses.)
The sky is not the limit, But when I reach the sky, for sure I will not try to go to the limit.... (donated $25,- upto now)

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: autostart .sh program at system boot.
« Reply #3 on: September 13, 2009, 06:52:12 AM »
Respecting SME design philosofy, you must add your script under local event (/etc/e-smith/events/local). Rename your script to S99thenameyouwant.sh

Please, read the local event description here:

http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual#Standard_events_and_their_arguments