![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sunsolaris shell script runs only as super user | gjithin | SUN Solaris | 4 | 05-09-2008 05:47 AM |
| How to use own account env variables to cron user | Tlg13team | HP-UX | 3 | 01-28-2008 05:38 AM |
| SFTP errorcode 1 when run on cron but runs manually | Heidi.Ebbs | SUN Solaris | 2 | 08-08-2007 09:16 AM |
| Old cron entry still runs, but shouldnt | xadamz23 | UNIX for Advanced & Expert Users | 3 | 10-11-2005 02:11 PM |
| cron user | finster | UNIX for Dummies Questions & Answers | 12 | 11-07-2004 08:24 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
What user runs cron?
I have a command that is found in /usr/ud51/bin called stopudt which safely stops idle database users (let's writes finish, etc).
If I login as root and issue stopudt [PID] the process is stopped. I put a script in cron to run it and it says stopudt not found. /usr/ud51/bin is in root's PATH. What other 'user' PATH do I need to modify... Or is that PATH the problem at all? Thanks for any help! |
| Forum Sponsor | ||
|
|
|
||||
|
michieka,
If you could post part of your script, I think the problem is in there. If you have ROOT, any script should run from there if it is in the PATH OR if you give the full path in cron or on the command line, which I always do to avoid problems with trojans and such. I see that you have the PID number as well from the commandline "/usr/ud51/bin/stopudt. How do you capture that from a script? Also, try creating a cron as that user. su - username then create a crontab as that user and execute it. See what you get from that.
__________________
My brain is your brain |
|
|||
|
Quote:
__________________
% man woman man: no entry for woman in the manual. |
|
|||
|
Running AIX 4.33. This is the script. I had to put some environment variables in there, but simply putting the PATH probably would have worked as well. Using sed and awk to get the PID numbers from who -u...
#!/usr/bin/ksh # # Logs users out that have been idle for 20 or more minutes. UDTBIN=/usr/ud51/bin UDTHOME=/usr/ud51 export UDTBIN export UDTHOME /usr/ud51/bin/stopudt `who -u | sed -e "s/\./0/" -e "s/://g" | awk '$6 > 20 {print $7}'` |
|
|||
|
Change default email for cron
How do I change who the default email goes to from cron jobs. I know it goes to the user by default. The man pages say I can use the mailto command, but I don't seem to have that on my system. AIX 4.33. How do you do it on yours?
|
|
||||
|
.forward email to root
You can redirect mail in a couple of ways. You can either use /etc/aliases for sendmail. or you can simply put a .forward in the user's home directory owned by root. Make the permissions 755.
/etc/aliases is a more efficient way to do it, but requires you to create a group and an alias name for the user. It works fine, but the simplest way is to use the .forward in that user home dir.
__________________
My brain is your brain |
||||
| Google The UNIX and Linux Forums |