473,785 Members | 2,428 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 3547
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
11279
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 in a certain directory and then fire the script when the file count reaches a certain number, and then clear out the directory... or something like that. Any suggestions? Thanks in advance.
4
3052
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 would like to change a (static/.html) web page every 10 minutes using PHP, is there a way to do this? I have an Apache/PHP/MySql also, so maybe theres a way to do it through these programs. Has any one done this before? How? AT will not do what...
2
13349
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 to. besides the php scripts, i have other scripts run under cron jobs, such as perl scripts and log files. I couldnt understand why my php scripts doesnt work under cron job.
6
2679
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
3052
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 the results to a text file called update.log. When I run the program in a bash shell with the...
6
1896
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 thru cron $sp1 is always null.
6
1824
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
4
2195
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 tell me what needs to be done to get an image via cron job. <?php //Header("Content-type: image/png"); $height = 300; $width = 300; $im = ImageCreate($width, $height);
4
7565
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. HOSTNAME is not one of those variables, it is set even in cron's subshell. Why doesn't python get...
0
9480
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10148
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3646
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.