homepage Welcome to WebmasterWorld Guest from 54.161.155.142
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Crontab From Command Line
JRobinson




msg:4079127
 4:58 pm on Feb 12, 2010 (gmt 0)

Please excuse my ignorance here, I'm just an old guy that plays around with this stuff as a hobby. I'm trying to get a script to run every hour and through an exhaustive search I've learned that I apparently have to set up a "crontab" to do this. I think I understand the concept of the '20 * * * * /path/to/file.php' command (I want it to run at 20 min past the hour) but what I don't understand and can't seem to find through searching is simply how to get the command window open or otherwise get to a command prompt so I can input the command. Can somebody help me out here?

Thanks,
Jim

 

rocknbil




msg:4079274
 8:34 pm on Feb 12, 2010 (gmt 0)

Welcome aboard JRobinson, this is not a PHP question, really It is an administration question. You set up a cron via command line to your server or via your hosting control panel. One way to access the command line of your server is via SSH, but if you are on shared or VPS/VDS hosting, this may not be possible. So most hosting services have this in their hosting control panel GUI and is easier to set up.

Log in your your hosting control panel, locate your domain, and you should see cron/crontab options. You set the frequency with with the cron runs, and just point it to this script. Let's say, daily at 12 AM; this means this script would run at midnight every day and clear out old session entries.

JRobinson




msg:4079373
 10:39 pm on Feb 12, 2010 (gmt 0)

Thank you for your reply rocknbil, sorry I posted in the wrong forum. I'm using a shared hosting thing through globat.com which I've found to be quite unrestrictive overall, but I've reached the conclusion that I must not have the proper permissions to set this up. I've been through every nook and cranny I could find in my control panel but wasn't able to find any cron options. I can set file permissions and edit my php.ini but apparently they draw the line with auto-excecuting scripts. I've got a support ticket going with the hosting company, I'll let you know how it turns out.

Thanks again,
Jim

JRobinson




msg:4079706
 6:54 pm on Feb 13, 2010 (gmt 0)

Problem Resolved. In response to my support ticket my hosting company added a "scheduled jobs" option in my control panel and I now have the script functioning as expected (archiving aviation weather reports from the NOAA server for flight simulation use). The scheduling was done through an easy to use UI so I didn't have to actually input any commands manually.

Thanks again for pointing me in the right direction rocknbil, and a special thanks to the Webmaster World community for all the answers I've found here in the past.

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved