Operating System - HP-UX
1833019 Members
2176 Online
110049 Solutions
New Discussion

Cron jobs not executed for specific user

 
SOLVED
Go to solution

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.
Dennis Handly
Acclaimed Contributor

Re: Cron jobs not executed for specific user

>Can you please explain what this command does?

It unsets all if your environment variables except for PATH. This is what crontab does.

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)?

Yes, you have to type everything. The stuff in () finds the PID for cron, so you don't have to.)

It basically runs tusc on cron and puts the output in tusc.out. Hopefully this should show us what is going on with cron and in particular for that user. (You need to start this before nmcman's crontab starts.)