cron user


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers cron user
# 8  
Old 11-05-2004
append to your existing PATH ,the PATH of all commands those needed to run the script ;

export PATH=$PATHSmilieathto all commands


put this at the begining of script.sh
# 9  
Old 11-05-2004
Sry for the smile symbol in the last post ....
For ex,

pathtoexp=/path/to/exp
export PATH=$PATH:$pathtoexp
# 10  
Old 11-05-2004
If I didn't want to edit the script (vendors script) could I just source *.cshrc file or add this to the cron entry. Usually I log in as oracle(c shell), cd to directory and ./ the script.

I would prefer not to edit the script.

Could I make my own script and insert the source *.cshrc then list script or can I just and to crontab with a ;.

The .cshrc file I believe contains the correct PATH or it references another file which contains the PATHs for this and Oracle.
# 11  
Old 11-05-2004
Yes, source your .cshrc, but don't source *.cshrc - specify what you are sourcing - if you put the wildcard in, you are asking for trouble.

Always specify exactly what you want -
source /export/home/oracle/.cshrc
# 12  
Old 11-05-2004
#setup environment for cron usage
. /export/home/oracle/backup.ksh

got it to work when I found a file that set up oracle's enviroment.
Edited my original script and added a pointer to the env file(backup.ksh)

Can anyone tell me why you have to lead with a "." - I found it on the NET but don't know why it is used? To prevent forks??

What the fork is a fork?
# 13  
Old 11-07-2004
If you run /export/home/oracle/backup.ksh like that, then it creates a child process that runs backup.ksh and then exits back to the parent process. You think, 'Well, I ran this, how come I don't see everything set up?!?!' It's because it ran as a child process - everything was set up there and then it exits.

Doing . /export/home/oracle/backup.ksh keeps it running as the parent process - and your environment gets set. It's the same as source /export/home/oracle/backup.ksh in csh. Read the man page on source.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Is CRON only for root user

Hi, i have question about cron. can we have user based cron file under /var/spool/cron or we should have only root file which can only be accessed by root user or admin and he should only be doing the task of scheduling. PKS (8 Replies)
Discussion started by: praveenkumar198
8 Replies

2. Shell Programming and Scripting

Cron Job for Fake User

There is a program that we (a company I'm working for) would like to run once per day, and the approach we're taking is to create a fake user to give a location to the data for this program, and to be the user running the program. For the sake of the discussion, let me call the fake user "bob". ... (5 Replies)
Discussion started by: stevendaryl
5 Replies

3. Solaris

! bad user (adm).. in cron log

I have noticed this error in /var/cron/log: > CMD: /usr/lib/acct/ckpacct > adm 6739 c Tue Oct 11 10:00:00 2011 < adm 6739 c Tue Oct 11 10:00:00 2011 rc=1 ! bad user (adm) Tue Oct 11 11:00:00 2011but when I try to list crontab of user 'adm': solarni/~# crontab -l adm crontab: you are... (4 Replies)
Discussion started by: orange47
4 Replies

4. Shell Programming and Scripting

Does running a cron job of a user require the user to be logged in?

Suppose user 'asdf' is not logged into server 'bbbb', but the server is up. User 'asdf' has cron job. Will it be executed? (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

5. Solaris

Is user cron job running in background?

Hi, Should the user jobs specified in crontab be running in background? Cron daemon is already running in background. So I am not sure whether should the jobs (output and error messages are redirected to file) ran by it be explicitly stated to be run in background (& at end of command) if one... (1 Reply)
Discussion started by: joe_x
1 Replies

6. Solaris

User entry in both cron.allow and cron.deny

Hello All, Anybody please help me to know ,what happens when a user having entry in both cron.allow and cron.deny files.Wheather the user will be able to access the crontab??? Thanks in advance Vaisakh (5 Replies)
Discussion started by: ksvaisakh
5 Replies

7. HP-UX

Create a user Specfic CRON

Hi there, I have a small script that I need to run every hour and would like to schedule this a a cron job. I have tried running it in root but due to elm not being setup and file permissions it does not work unless it is ran from a specfic account. Is it possible to setup a user cron and how... (5 Replies)
Discussion started by: lodey
5 Replies

8. Shell Programming and Scripting

adding a user to cron.allow

Hello all, I have solaris 10. I have have a script that installs crontab for a user. I want to add some more features to this script. I want to check whether the user exists in etc/cron.d/cron.allow ... if yes then continue the script without adding .... if not, then add that user to the... (6 Replies)
Discussion started by: MisterKhan
6 Replies

9. HP-UX

How to use own account env variables to cron user

hi all, i have one account for unix Tru64. i can login this account and i do execute special shell script(login sqlplus, execute another shell, etc... ) on this account on my server. but i can't run this shell from cron tab. i think that become cron user envirnoment variables. (3 Replies)
Discussion started by: Tlg13team
3 Replies

10. UNIX for Dummies Questions & Answers

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 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. ... (10 Replies)
Discussion started by: michieka
10 Replies
Login or Register to Ask a Question