473,387 Members | 1,789 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,387 software developers and data experts.

can't run a cron job

63
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 3529
eWish
971 Expert 512MB
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
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 Expert Mod 2GB
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 100+
I want a cron software for Windows.
Feb 6 '08 #5
arne
315 Expert 100+
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
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
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
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
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...
6
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
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
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
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.