473,549 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cron

155 New Member
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 3982
pbmods
5,821 Recognized Expert Expert
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 New Member
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 New Member
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 New Member
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
nizamkhir
1 New Member
/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
2662
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
3037
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 dns records at my dns provider, zoneedit. So basically, I've setup dynamic dns using python. Once the ip compare and/or update is complete, I log...
3
10295
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 following: runs several queries against different tables in a database; returns several lists of pictures being used in the database; removes any...
6
1809
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? any other possibilities to do something like this without having access to cron facilities? thanks giammy
5
3541
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 = localtime(time); print DATA "@Now\n"; exit ;
4
3939
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 4.4 32bit. Php does run as an Apache SO. It works perfectly if I just hit the page in a web-browser (output to browser). It works *perfectly*...
5
2314
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 logged in to a particular website at the current moment. Would it cause me trouble if I made this array static? If it would cause trouble, what's the...
4
7494
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 variable is not in the os.environ dictionary. I know that cron runs in a subshell that does not have all of the normally set environment variables. ...
0
3449
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 do not inherit this value. From "man bash": Shell Variables The following variables are set by the shell:
1
2294
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 and for each event do the work needed. It's basically like unix cron or like a calendar application with some restrictions. The outer loop may...
0
7520
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7450
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6043
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5088
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3481
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1941
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1059
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.