Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Hey guys, really need help here, wondering if any1 noe how 2 use cron ?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2007
    Posts
    59

    Bash cron update (SOMEBODY SAVE ME)


    Hey guys, really need help here, wondering if any1 noe how 2 use cron ?

  2. #2
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133
    Post the problem or question you have in as much detail as you can. Most people will have had experience with cron.

  3. #3
    Just Joined!
    Join Date
    Jul 2007
    Posts
    59
    hmm...let say i need to extract out words from the website whihc i already did...i need 2 use cron to sent the data, but hw do i write a script using that? also by the way is



    shop-t -s -o unounset?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru bigtomrodney's Avatar
    Join Date
    Nov 2004
    Location
    Ireland
    Posts
    6,133
    Cron is the scheduling daemon. If your command can run in one line you can enter it directly with crontab -e. If however your trouble is that you are not sure how to write a script you can check out many tutorials and literature.

    You can write a bash script by starting the file with
    Code:
    #!/bin/bash
    and placing a command on each line. The best place to start in my opinion is The Advanced Bash Scripting Guide. Don't worry it's the guide that's advanced, it does a good job of starting from the start.

    EDIT - Space in shabang removed.
    Last edited by bigtomrodney; 10-08-2007 at 10:50 AM.

  6. #5
    Just Joined!
    Join Date
    Jul 2007
    Posts
    59
    thx a lot but let say if i already done the script how do i execute it?

  7. #6
    Just Joined!
    Join Date
    Jul 2007
    Posts
    59
    Quote Originally Posted by bigtomrodney View Post
    Cron is the scheduling daemon. If your command can run in one line you can enter it directly with crontab -e. If however your trouble is that you are not sure how to write a script you can check out many tutorials and literature.

    You can write a bash script by starting the file with
    Code:
    #!/bin /bash
    and placing a command on each line. The best place to start in my opinion is The Advanced Bash Scripting Guide. Don't worry it's the guide that's advanced, it does a good job of starting from the start.

    how do i execute the command afteri have done the script using bash?....Ar...doing bash is hard man..

  8. #7
    Linux Enthusiast KenJackson's Avatar
    Join Date
    Jun 2006
    Location
    Maryland, USA
    Posts
    510
    Quote Originally Posted by jeffrey_seeNJ View Post
    how do i execute the command afteri have done the script using bash?....Ar...doing bash is hard man..
    Some of us thoroughly enjoy bash scripting. ....Ar....

    (Hey bigtomrodney, do you realize you put a space between "/bin" and "/bash"?)

    Once you've created the bash script, make it executable (chmod +x script) and use crontab to tell it to execute. I like to keep a local copy of my crontab file, which I save as ~/text/crontab.txt. After I edit it I execute this command:
    crontab ~/text/crontab.txt

    The file format is fully documented with man 5 crontab.
    Be sure to specify the script's whole path.
    My crontab.txt file generally looks something like this:
    Code:
    # crontab for Ken Jackson
    # Time fields:  minute, hour, day, month, day-of-week (0 or 7 is Sun)
    MAILTO=ken
    56  6  * * *  $HOME/bin/scriptone
    58 22  * * *  $HOME/bin/scripttwo

  9. #8
    Just Joined!
    Join Date
    Jul 2007
    Posts
    59
    Quote Originally Posted by KenJackson View Post
    Some of us thoroughly enjoy bash scripting. ....Ar....

    (Hey bigtomrodney, do you realize you put a space between "/bin" and "/bash"?)

    Once you've created the bash script, make it executable (chmod +x script) and use crontab to tell it to execute. I like to keep a local copy of my crontab file, which I save as ~/text/crontab.txt. After I edit it I execute this command:
    crontab ~/text/crontab.txt

    The file format is fully documented with man 5 crontab.
    Be sure to specify the script's whole path.
    My crontab.txt file generally looks something like this:
    Code:
    # crontab for Ken Jackson
    # Time fields:  minute, hour, day, month, day-of-week (0 or 7 is Sun)
    MAILTO=ken
    56  6  * * *  $HOME/bin/scriptone
    58 22  * * *  $HOME/bin/scripttwo

    u mean i have to type chmod + x name of my script to make it excutable??? But hw do i use crontab to exceute???

  10. #9
    Trusted Penguin Dapper Dan's Avatar
    Join Date
    Oct 2004
    Location
    The Sovereign State of South Carolina
    Posts
    4,630
    Default desktop environment for Mandriva is still KDE right? Do it with kcron. It should be in your menu. If not, from the command line:
    Code:
    kdesu kcron
    Linux Mint + IceWM Registered: #371367 New Members: click here

  11. #10
    Just Joined!
    Join Date
    Jul 2007
    Posts
    59
    Sounds difficult....any easier method like using xmod + ???

Page 1 of 2 1 2 LastLast

Posting Permissions

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