Intro to Cron jobs?

Discussion in 'Programming' started by Kat2, Sep 22, 2006.

  1. #1
    Hi all.

    My webhost is BlueHost and I have Spam Assassin enabled. Currently I have to go in daily or so and empty out my spam box. Is it possible to make a cron job to empty out the folder every 24 hours for me? If so, can you give me an intro to where I can learn about them?
     
    Kat2, Sep 22, 2006 IP
  2. DrMalloc

    DrMalloc Peon

    Messages:
    130
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Cron jobs will let you run any task or program at a scheduled interval, if you work out the command to empty your spam box a cron job should solve your problem fine. The syntax is detailed in this wikipedia article, and there are links at the bottom to other sites and even a windows implementation:

    http://en.wikipedia.org/wiki/Crontab
     
    DrMalloc, Sep 22, 2006 IP
  3. AMZN_YHOO

    AMZN_YHOO Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    is very simple

    first you write a crontab file, say filename.txt

    and the content of the file is like
    20 01 * * 1 YOUR_COMMAND

    then you issue the command
    crontab filename.txt

    YOUR_COMMAND will run at 01:20AM every Monday

    the syntax of the crontab file is like
    # MINUTE(0-59) HOUR(0-23) Date(1-31) Month(1-12) Day_of_Week(0-6, SUN=0) Command
     
    AMZN_YHOO, Sep 30, 2006 IP