473,414 Members | 1,628 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Cron

155 100+
Does anyone here know anything about crons?

My web hosting company (IX Webhosting) offers me no help.

To enter a cron I have to open my Control Panel - open FTP manager and open Crontab. I enter this for the day, time and command:

Expand|Select|Wrap|Line Numbers
  1. 5 1 * * 1
  2. /usr/bin/curl -s -o /dev/null/hsphere/local/home/myusername/mysite.com/scripts/remove.php
I just received an email from my server giving me the results of the cron:

curl: no URL specified!
curl: try 'curl --help' for more information


Supposedly, the script should run 5 minutes after 1:00am every Sunday. This cron job has been installed for over one month and I just now received one email telling me that it doesn't work.

I've also tried this:

Expand|Select|Wrap|Line Numbers
  1. 0 * * * *
  2. php /hsphere/local/home/myusername/mysite.com/scripts/remove.php
I recieved this message:

/bin/sh: php: command not found

Anyone have any ideas how I can put together a cron that actually works? I'm on a shared hosting server (like 98% of all websites), and it uses unix or linux.

Thanks
Jan 12 '09 #1
5 3973
pbmods
5,821 Expert 4TB
Heya, David.

Compare your settings against this handy-dandy reference:
cron - Wikipedia, the free encyclopedia

If you have shell access, use `which php` to find out where PHP is installed on your server (most likely /usr/bin/php or /usr/local/bin/php).

Otherwise, you can fake it by creating a quick PHP script to find out:

Expand|Select|Wrap|Line Numbers
  1. <?php echo `which php`; ?>
  2.  
Note that those are backticks, not quotes:
PHP: Execution Operators - Manual
Jan 13 '09 #2
DavidPr
155 100+
IXWebhosting does not allow Shell access. They use a program called WebShell, which is their FTP program, which is accessed by clicking on the File Manager icon in the Control Panel. I don't think they use C-Panel as their Control Panel, I believe it's their own design.

WebShell displays all of your domains and the folders and files located within each one. In my domain I have a folder called cgi-bin and in it is:

Php-cgi - 20.924MB
Php4-cgi - 5.296MB
Php5-cgi - 21.275MB

I assume this is the Php program's for my website.
Jan 13 '09 #3
DavidPr
155 100+
I'll try this:

/usr/bin/php /hsphere/local/home/myusername/mysite.com/scripts/remove.php

We'll see.
Jan 13 '09 #4
DavidPr
155 100+
Well I've tried these:

/usr/bin/php/hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: No such file or directory

/user/bin/hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: No such file or directory

/usr/local/bin/php/hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: No such file or directory

/usr/local/bin/hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: No such file or directory

/hsphere/local/home/myusername/mysite.com/scripts/raw_remove.php: Permission denied

The chmod for the immediate above is set to 755. So far, nothing I've tried has worked.
Jan 13 '09 #5
/hsphere/shared/php5/bin/php /local/home/myusername/mysite.com/scripts/scriptname.php
Jan 20 '16 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: sherryonline | last post by:
i have a page and i need that page to be called every day at 12:00 that page is going to connect to the database fetch some emails and will start mailing them how i am goning to do this.
4
by: vagrantbrad | last post by:
I'm using python 2.4 running on Fedora Core 4. I have written a python program called ipscan.py that checks the external ip address of my cable internet connection, and on change, will update the...
3
by: the.natalie | last post by:
Hi. I am a newbie to mysql, cron, and shell scripting, so please bear with me. I have a script that is used for updating an image directory based on contents in a database. The script does the...
6
by: giangiammy | last post by:
I don't know if this is possible, but I need to accomplish an action at a given hour (what cron does): is it possible to do something like this having a web hosting service with php support? ...
5
by: jcor | last post by:
Hi, I'm trying to run my first cron job, probably it's missing something. I created a perl script just to test, it's called "teste" !/usr/bin/perl open(DATA,">>/home/joao/files/output"); @Now...
4
by: Phil | last post by:
I have a php script that queries some Oracle DB and outputs a single line of plain text with <brat the end for each query. This is Apache2, php4.4.8 and Oracle Instant Client 10.1.0.5 all on CentOS...
5
by: Lawrence Krubner | last post by:
Do any problems come up when using a static variable in a cron job? Assuming the cron job is called every 5 minutes for one year. Assume I've got an array that stores the names of which users are...
4
by: Stephen Cattaneo | last post by:
Hello all, I am attempting to execute an automated test (written in Python) via cron. I have to check the HOSTNAME variable as part of the test, oddly under cron the HOSTNAME environment...
0
by: Cameron Simpson | last post by:
On 17Aug2008 21:25, John Nagle <nagle@animats.comwrote: Because $HOSTNAME is a bash specific variable, set by bash but NOT EXPORTED! Like $0 and a bunch of other "private" variables, subprocesses...
1
by: Karthik Gurusamy | last post by:
Hi, I'm working on a cron like functionality for my application. The outer loops runs continuously waking every x seconds (say x=180, 300, ..). It needs to know what events in cron has expired...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.