Operating System - HP-UX
1753640 Members
5340 Online
108798 Solutions
New Discussion юеВ

Re: Cron jobs not executed for specific user

 
SOLVED
Go to solution
Dennis Handly
Acclaimed Contributor

Re: Cron jobs not executed for specific user

>whereas as manual commands are successful.

Do the following to make sure manual commands fail:
$ env -i PATH=/usr/bin:/usr/sbin:. sh

Now try your "manual" commands and see if they fail with signal 9.

>What else can I check so as to find the root cause of the failure (ts=9)?

Have you stopped and restarted cron?
Have you rebooted after this user started failing?

I suppose you could use tusc on cron to see what it is doing:
tusc -fp -ea -o tusc.out $(UNIX95=EXTENDED_PS ps -C cron -o pid=)
Suraj K Sankari
Honored Contributor

Re: Cron jobs not executed for specific user

Hi,

Can you post the crontab -l and the script which is not executed.

Suraj
mvpel
Trusted Contributor

Re: Cron jobs not executed for specific user

Is the user's password expired by any chance? I've experienced Solaris no longer running cron jobs when someone forgot to change the root password before the maxage time in the /etc/shadow, perhaps HP-UX cron does something similar.

Re: Cron jobs not executed for specific user

>Do the following to make sure manual commands fail:
$ env -i PATH=/usr/bin:/usr/sbin:. sh

Now try your "manual" commands and see if they fail with signal 9.

Can you please explain what this command does?

>Have you stopped and restarted cron?
Have you rebooted after this user started failing?

cron was restarted and server was rebooted without result

>I suppose you could use tusc on cron to see what it is doing:
tusc -fp -ea -o tusc.out $(UNIX95=EXTENDED_PS ps -C cron -o pid=)

Can you please explain what this command does and if we have to type everything (even these that are in parenthesis)?
TTr
Honored Contributor

Re: Cron jobs not executed for specific user

> Now try your "manual" commands and see if they fail with signal 9.

> Can you please explain what this command does?

Can the nmcman user login to the server without any problems? After login can he/she execute the same commands from the cron job, by typing them on the unix command line?

You have not been giving answers to most of the questions that people have asked you here.

Re: Cron jobs not executed for specific user

i have mentioned before that nmcman user can execute everything manually whereas via crontab nothing works.

i asked what these commands do as i don't know and i don'twant to play with a live node.
Hakki Aydin Ucar
Honored Contributor

Re: Cron jobs not executed for specific user

>Steven: Also, if you're unsure about what damage this
command might do, you can replace "rm" with
"echo", which is much safer. Then, if you
see that it finds the files

You are right when it comes to be sure before deletion. .
Hakki Aydin Ucar
Honored Contributor

Re: Cron jobs not executed for specific user

sorry I was just on wrong link . !
OldSchool
Honored Contributor

Re: Cron jobs not executed for specific user

give the example:
csh -f /opt/mv36/core/lib/../script/mv36Backup /opt/mv36/core/data/data/ini/mv36Backup.ini -nointeractive -cron

1) when jobs that run manually don't run from cron, one suspect is that lack of the appropriate environment variables. The cron environment is minimalist.

2) I (personally) avoid running individual commands from cron, preferring to stick them in a script and run that. #1 above is one of the reasons why.

3) do you really need csh to run these? If mv36Backup *is* a script, and has the proper #! line at the top, you don't need to run the csh to start the script.

4) what happens if you stick that job in root's crontab and run it as follows:
su - nmcman -c "/opt/mv36/core/lib/../script/mv36Backup /opt/mv36/core/data/data/ini/mv36Backup.ini -nointeractive -cron"

note: if that runs properly, I'd really suspect an issue with the environment.....
TTr
Honored Contributor

Re: Cron jobs not executed for specific user

Did you add the "-x" option the the crontab kob as I pointed out earlier? "csh -f -x /opt/mv36..." to see if anything gets executed?

Did you check if nmcman gets any email from cron? Or look in /var/mail/nmcman for any clues?

Did you check /var/adm/syslog/syslog.log for any errors?

I can see that even a simple date command gives ts=9 and you have tried the mv36Backup cron job with and without the csh wrapper.