Link to home
Start Free TrialLog in
Avatar of iaguirre
iaguirreFlag for Spain

asked on

NIS maps actualization

How can I make the actualization of my NIS maps automatically?

Manually I do it by typing:
cd /var/yp
make

But I introduce it in a script and the execute it in the
root's crontab it does not work.

The NIS server works under SunOS 4.1.3
TIA
Avatar of plebras
plebras

HI !

Normally no problem

I think your line in root's crontab may be false. You must specify the complet path of the script (no default path except /bin in cron) in the line and also in the script eg :

0 10  * * * * /home/script

The script look like this

cd /var/yp
/var/yp/make

You must also set the rights by : "chmod 755 /home/script"
and then reinit cron by

"crontab root"

To verify type :
"crontab -l"

You must see your line

Bye
Avatar of iaguirre

ASKER

It does not work. I caan not execute /var/yp/make it answers
"Command not found"

Moreover if I execute the script form the command line it works
but not in the crontab. This is my script:

#!/bin/csh
cd /var/yp >&! /sysutils/propaNIS.res
make >>& /sysutils/propaNIS.res

and this is my crontab:
15 3 * * * find / -name .nfs\* -mtime +7 -exec rm -f {} \; -o -fstype nfs -prune
5 4 * * 6 /usr/lib/newsyslog >/dev/null 2>&1
15 4 * * * find /var/preserve/ -mtime +7 -a -exec rm -f {} \;
20 12 * * * /sysutils/propaNIS

check your environment variables. You can print them as the first action in your script. Then run it online and within crontab.

Verify the two environment and you will see some differences. Try setting the needed env vars inside the script so there also available at 'crontab' execution
Ok there was some problem with the environment
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial