Path: utzoo!attcan!uunet!samsung!sdd.hp.com!uakari.primate.wisc.edu!aplcen!jhunix!shan_x@jhuvms.bitnet From: shan_x@jhuvms.bitnet Newsgroups: comp.lang.perl Subject: help needed: running perl script with cron Keywords: perl script, cron, quot Message-ID: <5859@jhunix.HCF.JHU.EDU> Date: 19 Jul 90 01:20:06 GMT Sender: che_wgp@jhunix.HCF.JHU.EDU Reply-To: shan_x@jhuvms.bitnet Organization: The Johns Hopkins University - HCF Lines: 30 ====================================== The following perl script calculates disk space used by all users. If I run it interactively, it works fine. But if I put it in "crontab", it runs but doesn't output anything. It seems if "cron" runs it, "open(IN, 'quot|')" doesn't work. I really can't figure out what is wrong with it. Any help is greately appreciated. Reply here or send it to "shan@sphunix.sph.jhu.edu". I have perl3.0 at patch 18 in DECsystem 3100. --Shan #!/usr/bin/perl chdir("/user/admin/shan/.acct")||die "can't change dir"; open(OUT,'>test.out')|| die "can't open output"; open(IN,'quot|')|| die "Can't open quot pipe\n"; select(OUT);$|=1; while(){ chop; s/^\s*//; next if /\/+/; ($disk,$user)=split('\s+',$_,2); $dusage{$user} +=$disk; } foreach $user (sort keys %dusage){ print OUT "$user $dusage{$user}\n"; } close(OUT);