Cronjob and Perl "qq"
Posted in 1998
Topics: SQL Development & Query Writing, Server Administration, Migration, Import/Export & Data Conversion
Can any one tell me why my scripts work when i run them manually but when i
run them in a cron i get errors? I think it has to do with perl's "qq"
command because if i take out everything associated with the 'qq' command, my
error goes away and the scripts work. but obviously i need the 'qq'. Thanks
in Advance.
"broken pipe" error on this script
#!/usr/local/bin/perl
chdir ("/u/scripts/edv");
$hh = 12;
$ENV{'INFORMIXSERVER'} = "n36_shm";
open (DBACCESS, "| dbaccess");
print DBACCESS qq{
database pmsys\\@n36;
UNLOAD TO 'abc.txt'
SELECT MAX(ostime)
FROM ama0_980806
WHERE EXTEND (ostime, HOUR to HOUR) = "$hh"; };
close (DBACCESS);
print "at end\\n";
"sh: dbaccess: not found" error on this script
#!/usr/local/bin/perl
chdir ("/u/scripts/edv");
$hh = 2;
$ENV{INFORMIXSERVER} = "n36_shm";
system qq{
dbaccess << 'eof'
database pmsys\\@n36;
UNLOAD TO 'abc.txt'
SELECT cfc
FROM ama0_980714
GROUP BY direct, cfc
HAVING direct = "$hh";eof
};
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum