473,503 Members | 2,259 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can't run a cron job

63 New Member
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"
Expand|Select|Wrap|Line Numbers
  1. !/usr/bin/perl
  2. open(DATA,">>/home/joao/files/output");
  3. @Now = localtime(time);
  4. print DATA "@Now\n";
  5. exit ;
  6.  
I created the file "teste.cron" with the cron job. it's only a line with:
* * * * * /home/joao/files/teste

I uploaded the cron job with "crontab teste.cron"

Shouldn't this be writing the date and time every minute in the file "output"?

When I run my script manually it writes correctly in the file "output";
If I type "crontab -l" I can see my cron job loaded;

can somebody give me an hand?

thanks,

Joćo
Sep 24 '07 #1
5 3536
eWish
971 Recognized Expert Contributor
I am not sure if you got this issue resolved. If not the there is an article that may help you.
Nov 9 '07 #2
jcor
63 New Member
thanks for your help. I didn“t solve this problem at the time but get my goal monitoring a folder pernmanently and triggering when occured changes instead of running the code in a cron job. Anyway i'll read the article for further using.


thanks,

Joćo
Nov 9 '07 #3
numberwhun
3,509 Recognized Expert Moderator Specialist
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"
Expand|Select|Wrap|Line Numbers
  1. !/usr/bin/perl
  2. open(DATA,">>/home/joao/files/output");
  3. @Now = localtime(time);
  4. print DATA "@Now\n";
  5. exit ;
  6.  
I created the file "teste.cron" with the cron job. it's only a line with:
* * * * * /home/joao/files/teste

I uploaded the cron job with "crontab teste.cron"

Shouldn't this be writing the date and time every minute in the file "output"?

When I run my script manually it writes correctly in the file "output";
If I type "crontab -l" I can see my cron job loaded;

can somebody give me an hand?

thanks,

Joćo
Personally, I would want to see what cron is saying since it runs silently. So, that said, I would change the entry to be:

* * * * * /home/joao/files/teste > /home/joao/files/cronjob.log

and see if the log file shows anything happening.

The entry looks right and the code, aside from having asthetic issues (ie: no "use warnings" or "use strict") seems to look like it would work. Try that and see what is output to the log file.

Regards,

Jeff
Nov 9 '07 #4
pankajit09
296 Contributor
I want a cron software for Windows.
Feb 6 '08 #5
arne
315 Recognized Expert Contributor
I want a cron software for Windows.
Did you try to Google for "cron windows"? There seem to be several projects that provide cron functionality on windows.

HTH,
arne
Feb 7 '08 #6

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

Similar topics

29
11223
by: deko | last post by:
Is there a way to get my script to run on regularly scheduled intervals without using cron? My hosting provider sucks... cannot use cron... I was thinking perhaps I could create a file every hour...
4
3023
by: Doug | last post by:
I have Windows XP professional. Is there ANYTHING reliable on Windows that is like cron on UNIX that will allow you run something at regular intervals, for example, like every 10 minutes? I...
2
13327
by: volantecho | last post by:
hi, i m using webmin to create a cron job of a php script. While i click on 'run it now', it works, generate the output. However, the php script doesnt execute for every minutes which i've set...
6
2658
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
3032
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...
6
1878
by: BG Mahesh | last post by:
hi I am using PHP 5.0.4 on OpenSuse 10.x. I have the following piece of code, $sp1 = $_SERVER; $sp1 is set correctly when I execute file.php thru the browser. But when I run that script...
6
1802
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? ...
4
2180
by: pushpen | last post by:
I'm trying to run the following php code along with gd library as a cron job ,but cron is not generating any output. When I run this code from my browser I get an image correctly. Somebody please...
4
7486
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
7093
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
7291
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,...
0
7357
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
7468
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...
1
5023
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...
0
4690
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...
0
1522
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 ...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.