This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Cron problem


Mark schrieb:

> Give me simple one or two-line perl scripts that duplicate your problem
> and I will try them.  The scripts should just print the working
> directory or the date or something simple like that.  It sounds like a
> PATH problem or a mount-point problem or the startup mode of cron.  Is
> CYGWIN="binmode ntfs tty"?

Yep (ntsec;).


script1.pl:
#!/usr/bin/env perl
$cmd = "perl /path/script2.pl";
system $cmd;
1;

script2.pl:
#!/usr/bin/env perl
print "I'm script two.\n"
1;

crontab -e:
MAILTO=your@address.here
1 * * * * /usr/bin/perl /path/script1.pl

Put both scripts in /path no mounts are involved.
The mail from Cron:
Can't open perl script "/path/script2.pl": No such file or directory

It seems to be the problem that I didn't used an absolute path to perl
in script1.pl.
It works ok. if I change it to /usr/bin/perl.
It seems that Cron is running the wrong perl.  I need to fix my path.


Thanks for your help,

Gerrit
-- 
=^..^=


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]