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 ;
-
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
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.
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
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" -
!/usr/bin/perl
-
open(DATA,">>/home/joao/files/output");
-
@Now = localtime(time);
-
print DATA "@Now\n";
-
exit ;
-
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
I want a cron software for Windows.
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
Sign in to post your reply or Sign up for a free account.
Similar topics |
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.
|
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...
|
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.
|
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.
|
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...
| |
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.
|
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
|
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);
|
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...
|
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,...
|
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...
| |
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...
|
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,...
|
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...
|
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 projectplanning, coding, testing, and deploymentwithout 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...
|
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...
|
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...
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |