Results 1 to 5 of 5

Thread: Anybody knows how to deamonize a shell script ?

  1. #1
    Senior Member registered user
    Join Date
    Mar 2003
    Location
    Belgium
    Posts
    252

    Anybody knows how to deamonize a shell script ?

    sh scriptname.sh

    => bu how to deamonize this ?

  2. #2
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041

    Re: Anybody knows how to deamonize a shell script ?

    --What do you mean by "daemonize"? Daemons stay running in the background looking for connections or facilitating I/O.

    --If you just want it to run every time at boot, you can create a link to the script in the /etc/rc5.d directory.

    This thread ( http://www.knoppix.net/forum/viewtopic.php?t=3138 ) may be of use.

    Quote Originally Posted by ktheking
    sh scriptname.sh

    => bu how to deamonize this ?

  3. #3
    Senior Member registered user
    Join Date
    Mar 2003
    Location
    Belgium
    Posts
    252
    I'd like to run a script that continiously is running ,even after quiting a knoppix session.
    It's a script that contains timed actions ,mainly used for the same purpose as 'Scheduled tasks' inside windoze .

    By the way isn't there something like that for KDE ?

  4. #4
    Senior Member registered user
    Join Date
    Nov 2002
    Location
    USA, IL
    Posts
    1,041
    --You should probably investigate ' man cron '...

    Quote Originally Posted by ktheking
    I'd like to run a script that continiously is running ,even after quiting a knoppix session.
    It's a script that contains timed actions ,mainly used for the same purpose as 'Scheduled tasks' inside windoze .

    By the way isn't there something like that for KDE ?

  5. #5
    Senior Member registered user
    Join Date
    Mar 2003
    Location
    Belgium
    Posts
    252
    This sounds exactly what I need..
    Thanks a lot man .... (just gotta do my homework and learn to use it )

    man cron :

    Using cron to run programs on a schedule
    cron is a Linux system process that will execute a program at a preset time. To use cron you must prepare a text file that describes the program that you want executed and the times that cron should execute them. Then you use the crontab program to load the text file that describes the cron jobs into cron.

    Here is the format of a cron job file:

    [min] [hour] [day of month] [month] [day of week] [program to be run]

    where each field is defined as [min] Minutes that program should be executed on. 0-59. Do not set as * or the program will be run once a minute.
    [hour] Hour that program should be executed on. 0-23. * for every hour.
    [day of month] Day of the month that process should be executed on. 1-31. * for every day.
    [month] Month that program whould be executed on. 1-12 * for every month.
    [day of week] Day of the week. 0-6 where Sunday = 0, Monday = 1, ...., Saturday = 6. * for every day of the week.
    [program] Program to be executed. Include full path information.


    Here are some examples:

    0,15,30,45 * * * * /usr/bin/foo

    Will run /usr/bin/foo every 15 minutes on every hour, day-of-month, month, and day-of-week. In other words, it will run every 15 minutes for as long as the machine it running.

    10 3 * * * /usr/bin/foo

    Will run /usr/bin/foo at 3:10am on every day.

    10 * 1 * * /usr/bin/foo

    Will run /usr/bin/foo at 12:10am on the first day of the month.

    10 * * 1 * /usr/bin/foo

    Will run /usr/bin/foo at 12:10am on the first month of the year.

    10 14 * * 1 /usr/bin/foo

    Will run /usr/bin/foo at 2:10pm on every Monday.

    There are more options for these. See man man crontab -S 5.

    You must use crontab to load cron jobs into cron. First create a text file that uses the above rule to describe the cron job that you want to load into cron. But before you load it, type crontab -l to list any jobs that are currently loaded in crontab.

    If none are listed, then it is safe to load your job. Example. If you wanted to run /usr/local/bin/foo once a day at 3:10am, then create a text file

    10 3 * * * /usr/bin/foo

    Save it as foo.cron. Then type crontab foo.cron. Check to see if it was loaded by typing crontab -l. It should display something like this:

    # DO NOT EDIT THIS FILE - edit the master and reinstall.
    # (ipwatch.cron installed on Thu Nov 18 11:48:02 1999)
    # (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
    10 3 * * * /usr/bin/foo

    If you want to edit the cron job, then edit foo.cron and then remove the existing cron job (crontab -r) and load it again (crontab foo.cron). You can have multiple jobs. Just put each different one on a seperate line in foo.cron.

    contab jobs will run under the user that was in effect when you loaded the job in crontab.

    See man cron, man crontab and man crontab -S 5 for more information.

Similar Threads

  1. running shell script
    By splittik in forum General Support
    Replies: 1
    Last Post: 03-22-2005, 07:38 AM
  2. Help with shell script + startup
    By niXnoob in forum General Support
    Replies: 3
    Last Post: 10-06-2004, 04:56 AM
  3. Replies: 3
    Last Post: 06-05-2004, 03:51 AM
  4. tcsh shell on Knoppix
    By sorel in forum General Support
    Replies: 1
    Last Post: 04-20-2004, 08:39 PM
  5. Perl Bug??? Shell problem??
    By xeon44145 in forum General Support
    Replies: 0
    Last Post: 02-12-2004, 03:04 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


NEW Cisco Meraki MS130-48P-HW 48-Port Gigabit PoE+ Cloud Manage Switch UNCLAIMED picture

NEW Cisco Meraki MS130-48P-HW 48-Port Gigabit PoE+ Cloud Manage Switch UNCLAIMED

$2999.99



Cisco WS-C3650-12X48UR-L 48-Port Stackable Layer 3 8x10G SFP+ Port Switch picture

Cisco WS-C3650-12X48UR-L 48-Port Stackable Layer 3 8x10G SFP+ Port Switch

$129.99



Cisco Acacia DP04QSDD-E25-840 400G QSFP-DD Coherent DCO Transceiver Module picture

Cisco Acacia DP04QSDD-E25-840 400G QSFP-DD Coherent DCO Transceiver Module

$699.99



Cisco Catalyst C9130AXI-B WiFi 6 802.11ax Wireless Access Point Brand New picture

Cisco Catalyst C9130AXI-B WiFi 6 802.11ax Wireless Access Point Brand New

$101.99



Cisco Nexus N9K-C92160YC-X 48P 25GbE SFP28 6P QSFP+/QSFP28 PE Switch picture

Cisco Nexus N9K-C92160YC-X 48P 25GbE SFP28 6P QSFP+/QSFP28 PE Switch

$439.00



Cisco | N3K-C3232C | 32-Port 100G QSFP Network Switch  W/ 2x PSU, 2x Power Cords picture

Cisco | N3K-C3232C | 32-Port 100G QSFP Network Switch W/ 2x PSU, 2x Power Cords

$240.00



Cisco C9300-48UXM-A Switch 9300 Series 48-port UPoE Network picture

Cisco C9300-48UXM-A Switch 9300 Series 48-port UPoE Network

$874.99



New Sealed Cisco GLC-LH-SMD 1000BASE-LX/LH SFP Transceiver Module *US picture

New Sealed Cisco GLC-LH-SMD 1000BASE-LX/LH SFP Transceiver Module *US

$17.00



NEW Sealed Cisco SFP-10G-LR 10GBASE-LR SFP+ 1310nm 10km *US Shipping* picture

NEW Sealed Cisco SFP-10G-LR 10GBASE-LR SFP+ 1310nm 10km *US Shipping*

$24.00



Cisco XFP-10G-MM-SR 10G XFP Transceiver picture

Cisco XFP-10G-MM-SR 10G XFP Transceiver

$79.89