Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Questions about cron and php script

Original Message
Name: colin72
Date: March 23, 2008 at 07:24:37 Pacific
Subject: Questions about cron and php script
OS: Win XP
CPU/Ram: Pent 4/1 GB
Model/Manufacturer: Dell Dimension 4700
Comment:
I'm trying to set up a php script that runs via crontab on a Linux server. I've never done anything like this before. If you can offer any help, please provide as much detail as you can. Thank you for taking the time to read this...


My questions:

1) I want the crontab to run the script everyday from 3:58 PM to 4:13 PM EST. How is that written in crontab?

2) The command I want crontab to run is: php -q /path/to/script.php
According to that path name, where do I put the php script on my server? Do I have to create a folder named "path" with a folder named "to" in it, and put "script.php" in that folder?


Thanks!

More about question #1...

I can access my server through Cpanel (Hostgator). In Cpanel they provide two ways to enter a crontab. Here are screenshots showing both of those Cron Managers:
http://www.iov.in/cpanelcronmanager...


Because I want crontab to run the php script from 3:58 pm EST until 4:13 pm EST, I'm wondering how I am going to be able to enter that into either Cron Managers that Hostgator provides. There doesn't seem to be a way to enter a crontab so it starts 2 minutes before one hour (3 pm) and runs until 13 minutes after the next hour (4 pm).

Once someone does help me with the way the cronjob needs to be written, any ideas on how I enter that code into either one of the Cpanel Cron Managers? If I have to upload the crontab code to the server without using CPanel, how do I do that?


Thanks!


Report Offensive Message For Removal


Response Number 1
Name: Razor2.3
Date: March 24, 2008 at 19:41:14 Pacific
Subject: Questions about cron and php script
Reply: (edit)
I don't think cron will let you specify when a job will end; only when it'll start.

1)

58 15 * * * <Your User> php -q /path/to/script.php

2) You modify the /path/to to the real path. Otherwise, you'd have to make a directory called path in the root, then add a directory to to path.


Report Offensive Follow Up For Removal

Response Number 2
Name: colin72
Date: March 25, 2008 at 19:46:12 Pacific
Subject: Questions about cron and php script
Reply: (edit)
Hi Razor

So basically for "php -q /path/to/script.php" I can change it to "php -q /script.php" and then put the script.php file in the root?


Report Offensive Follow Up For Removal

Response Number 3
Name: Razor2.3
Date: March 25, 2008 at 20:40:17 Pacific
Subject: Questions about cron and php script
Reply: (edit)
Sure. You probably shouldn't have scripts lying around in root, but I don't think anything prevents it.

Report Offensive Follow Up For Removal




Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Questions about cron and php script

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




Slow boot time

Trasnferring Documents from old HD

My k8T Neo-v usb's aren't working!

Date Modified = Date Created Time

system files on removable harddrive


The information on Computing.Net is the opinions of its users. Such opinions may not be accurate and they are to be used at your own risk. Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE

All content ©1996-2007 Computing.Net, LLC