Could someone explain my problem?
I've the following script...
When I start this program in shell, it is running whitout problem and I've got the result in the file /home/op/report.txt.
But when I start this program via crontab, it is running whitout problem BUT it doesn't create the /home/op/report.txt
What's the problem? what I should doing?
Best regards
I've the following script...
Code:
#! /bin/ksh
...
vmquery -m $MediaID | awk '
BEGIN {FS=": "
getline expdate <"ExpDate.txt"
}
$1 ~ /media ID/ {MediaNumber = $NF}
...
$1 ~ /number of mounts/ {
"date +%Y"|getline YearToday
Year4 = YearToday - 4
if ($NF > 2000)
{
if (expdate ~ "[0-9]\{2\}\/[0-9]\{2\}\/[0-9]\{4\}")
{
printf("\t %s \n\n","=case 1==================") >>"/home/op/report.txt"
printf("%-20s\t %s\t %s\n","Media Number",":",MediaNumber) >>"/home/op/report.txt"
...
But when I start this program via crontab, it is running whitout problem BUT it doesn't create the /home/op/report.txt
What's the problem? what I should doing?
Best regards