crontab with .profile

crontab with .profile

Post by Ini Chun » Tue, 14 Mar 2000 04:00:00



Hi,

I want to use my .profile environment to execute cron jobs on Son OS 5.7
But I don't know how to do it.

In the man page of crontab :

  " Users who desire to have their .profile executed must  explicitly do so
in the  rontab   file. "

Any help would be appreciated.

 
 
 

crontab with .profile

Post by Adam Pric » Tue, 14 Mar 2000 04:00:00



>Hi,

>I want to use my .profile environment to execute cron jobs on Son OS 5.7
>But I don't know how to do it.

>In the man page of crontab :

>  " Users who desire to have their .profile executed must  explicitly do so
>in the  rontab   file. "

At the start of the script you want to run from cron, put the line
. $HOME/.profile
to execute your profile inline in the same shell as the current script.

Note, this is probably not a good idea and better would be to find out
which parts of your profile the script needs, and place them directly
in the script. This way you won't break your cron jobs if you change
your .profile .
Hope this helps
Adam
--
Please don't send me email.
If you must, then use the address as given, there is no spam-block.
Please think before you post, and read the FAQ before you think
about posting.

 
 
 

crontab with .profile

Post by Chuck Dougla » Thu, 16 Mar 2000 04:00:00



> Hi,

> I want to use my .profile environment to execute cron jobs on Son OS 5.7
> But I don't know how to do it.

> In the man page of crontab :

>   " Users who desire to have their .profile executed must  explicitly do so
> in the  rontab   file. "

> Any help would be appreciated.

The following with execute your profile and command every night at
5 minutes past midnight:

0 5 * * * .  /home0/userid/.profile;command

Note the '.' at the beginning of /home0/userid/.profile
This will execute the contents of you .profile before the command
runs to set up the environment.

You should, of course, replace it with the correct path to your
.profile file.

--

     "I don't pretend I have all the answers/Just the obvious ones"
                    --_Backbone_ by Baby Animals
                   Homepage down until further notice.

 
 
 

1. crontab problem: I can't run a java program via crontab

I have write a ksh script and put it in crontab to run daily, the script
run successful at command prompt but have error in crontab, the script
as follow:

set $CLASSPATH = {list of classpath}
cd /u01/home/renren/source
pwd                                            //successful go to the
correct path
/usr/local/bin/gunzip -cd /var/log/apache/*.gz | /usr/java/bin/java
util.CheckApacheLog

Can anyone tell me how to fix it?

2. Majordomo/procmail problems

3. crontab -e or crontab -l is not functioning properly

4. Cannon BJC-210 printer and Staroffice 5.0

5. crontab entries generate error message; problem with ownership of crontab file?

6. Finger

7. To crontab or NOT to crontab!!!

8. test

9. fix to crontab problem ("no changes made to crontab")

10. link a crontab -> "crontab -e" remove link

11. RH difference between /etc/crontab and crontab -e

12. ksh not reading /.profile or /etc/profile

13. Profile/.profile/.bash_rc/et al.