Find the answer to your Linux question:
Results 1 to 6 of 6
Dear All, I am newbie in the vast field of linux. I have a perl scrip sys.pl which i can easily execute in command line by typing ./sys.pl i.e imtiaz@linux-q01x:~> ...
  1. #1
    Banned
    Join Date
    Jun 2007
    Posts
    3

    Exclamation cron job

    Dear All,

    I am newbie in the vast field of linux.

    I have a perl scrip sys.pl which i can easily execute in command line by typing

    ./sys.pl

    i.e
    imtiaz@linux-q01x:~> cd folder
    imtiaz@linux-q01x:~/folder> /.sys.pl

    now i want to set up a cron job for this script to execute automatically on every week on Monday at 1:00 PM

    can you please tell me how to set up a cron job for this

    I am using SUSE 10.2

  2. #2
    Linux User infoshirish's Avatar
    Join Date
    May 2007
    Location
    Pune, India
    Posts
    397

    Cool

    Hey,
    Edit your crontab file by giving crontab -e and edit the file exactly as
    0 13 * * monday /usr/bin/myperlscript -n 1 -b -S

    '0' and '59' (minutes of the hour). 13 is your 1 pm(hours of the day)
    This command will execute every day at 1 pm. Note that the script which you wanted to run under crontab should be in your /usr/bin/myperlscript or any other where you have installed perl.
    Regards,

    who |grep -i blonde |
    date; cd~; unzip; touch;
    strip; finger; mount; gasp;
    yes; uptime; umount;
    sleep

    Newbie clicks
    http://www.linuxforums.org/forum/lin...ead-first.html

  3. #3
    Just Joined! sharik_pahwa's Avatar
    Join Date
    Jun 2007
    Posts
    29

    Wink

    try
    #crontab -e
    add a line as :

    0 13 * * mon ./sys.pl

    else refer to man 5 crontab for further details.

  4. #4
    Banned
    Join Date
    Jun 2007
    Posts
    3
    Quote Originally Posted by infoshirish View Post
    Hey,
    Edit your crontab file by giving crontab -e and edit the file exactly as
    0 13 * * monday /usr/bin/myperlscript -n 1 -b -S

    '0' and '59' (minutes of the hour). 13 is your 1 pm(hours of the day)
    This command will execute every day at 1 pm. Note that the script which you wanted to run under crontab should be in your /usr/bin/myperlscript or any other where you have installed perl.
    if i have more than one scripts in that directory myperlscript it mean that all will be set to cronjob? But in my case I just want to set one i.e sys.pl

    please can you explain these tabs
    -n 1 -b -S

  5. #5
    Banned
    Join Date
    Jun 2007
    Posts
    3
    Quote Originally Posted by sharik_pahwa View Post
    try
    #crontab -e
    add a line as :

    0 13 * * mon ./sys.pl

    else refer to man 5 crontab for further details.
    Will this automatically search ./sys.pl or i have to specify the director y address where my script is located?

  6. #6
    Linux User infoshirish's Avatar
    Join Date
    May 2007
    Location
    Pune, India
    Posts
    397

    Cool

    Hey,
    Well first cross check it by running some test script of perl in that directory under crontab. If success then try to run any script you want.
    Regards,

    who |grep -i blonde |
    date; cd~; unzip; touch;
    strip; finger; mount; gasp;
    yes; uptime; umount;
    sleep

    Newbie clicks
    http://www.linuxforums.org/forum/lin...ead-first.html

Posting Permissions

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