1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

command to run in SSH puTTy

Discussion in 'Site & Server Administration' started by bersude2, May 11, 2009.

  1. #1
    I'm trying to run a command in puTTy via SSH and trying to create a crontab...

    I keep getting errors, but may be just syntax errors, if you see anything specifically wrong please let me know. Basically, I'm just trying to setup cron on Interspire every minute or every 2 minutes on every hour, every day

    
    root@host [~]# crontab * * * * * usr/bin/php/home/hpsurvey/public_html/Interspire/upload/admin/cron/cron.php
    "anaconda-ks.cfg":3: bad minute
    errors in crontab file, can't install.
    
    root@host [~]# crontab */2 * * * * usr/bin/php/home/hpsurvey/public_html/Interspire/upload/admin/cron/cron.php
    */2: No such file or directory
    
    
    Code (markup):
     
    bersude2, May 11, 2009 IP
  2. cfortner

    cfortner Peon

    Messages:
    46
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's a syntax error. If you want the cron to run every two minutes, it would look something like this:

    crontab 0,2,4,6,8,10,12,14 * * * * /command

    The first field where you are using an * is the minute field. In my above example it would run at 12:00, 12:02, 12:04, 12:06, 12:08, 12:10, 12:12, and 12:14, and would repeat that every hour of the day. You can put multiple minute times in this field seperated by a comma. For more info see the following tutorial:

    http://www.adminschoice.com/docs/crontab.htm
     
    cfortner, May 11, 2009 IP
  3. Camay123

    Camay123 Well-Known Member

    Messages:
    3,423
    Likes Received:
    86
    Best Answers:
    0
    Trophy Points:
    160
    #3
    crontab -e

    This is to edit your crontab file.

    Then input :

    */2 * * * * usr/bin/php/home/hpsurvey/public_html/Interspire

    and save your crontab file.
     
    Camay123, May 11, 2009 IP
  4. tsenseless

    tsenseless Active Member

    Messages:
    368
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Due to the newbieness of the poster (no offense intended), I doubt he'll be able to figure out how to exit vi! (i hate that program)

    That said, try this.

    CMD1) export EDITOR=nano
    CMD2) crontab -e
    (when the editor loads, copy and paste your line, the original line you had was fine)
    */2 * * * * php -q /home/hpsurvey/public_html/Interspire/upload/admin/cron/cron.php
    then press ctrl + x and save the file. It'll automatically implement it.

    You can see existing crontabs under your user by typing 'crontab -l' on the console. If you still have problems with the method above copy and paste the following line into your console and it'll work.

    
    echo "*/2 * * * * php -q /home/hpsurvey/public_html/Interspire/upload/admin/cron/cron.php" > crontmp ; crontab crontmp ; rm -f crontmp
    
    Code (markup):
     
    tsenseless, May 19, 2009 IP