Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.sys.mac.system > #78376
| From | Jolly Roger <jollyroger@pobox.com> |
|---|---|
| Newsgroups | comp.sys.mac.system |
| Subject | Re: cron as root |
| Date | 2015-08-03 14:12 +0000 |
| Organization | People for the Ethical Treatment of Pirates |
| Message-ID | <d29b6tFjn67U7@mid.individual.net> (permalink) |
| References | <1m8jveg.26jjio2tnj4yN%csampson@inetworld.net> <d298lhFjn67U1@mid.individual.net> |
On 2015-08-03, Jolly Roger <jollyroger@pobox.com> wrote: > On 2015-08-03, Charles H. Sampson <csampson@inetworld.net> wrote: > >> I've noticed that when I am logged in as root and run Terminal, the >> .bashrc file doesn't get executed. Guessing again, I think that this >> is because when starting Terminal as root, a new Unix process doesn't >> get started; instead I am just connected to the root process that is >> always running. Whether this guess is right or not, my problem >> remains. How do I execute my script with cron? > > If you want a script to execute when a user logs in, then cron is > probably not the best tool for the job. What I would do instead is > modify the shell startup scripts (like ~/.bashrc etc) for the account in > question to execute the script. If you think a shell startup file is not being executed, try adding just a single line to the ~/.bashrc file for debugging purposes: echo "bashrc executed!" When you open a new terminal window in that account, you should see the message displayed. If not, it's possible the account in question uses a shell other than bash. In that case, you probably need to edit a different shell startup file in the home directory of that user account. Or you could switch the shell to bash for that account. -- E-mail sent to this address may be devoured by my ravenous SPAM filter. I often ignore posts from Google. Use a real news client instead. JR
Back to comp.sys.mac.system | Previous | Next — Previous in thread | Next in thread | Find similar
cron as root csampson@inetworld.net (Charles H. Sampson) - 2015-08-02 23:46 -0700
Re: cron as root Huge <Huge@nowhere.much.invalid> - 2015-08-03 07:30 +0000
Re: cron as root Jolly Roger <jollyroger@pobox.com> - 2015-08-03 13:29 +0000
Re: cron as root Jolly Roger <jollyroger@pobox.com> - 2015-08-03 14:12 +0000
Re: cron as root csampson@inetworld.net (Charles H. Sampson) - 2015-08-09 12:29 -0700
Re: cron as root Barry Margolin <barmar@alum.mit.edu> - 2015-08-09 18:59 -0500
Re: cron as root csampson@inetworld.net (Charles H. Sampson) - 2015-08-09 23:53 -0700
Re: cron as root Barry Margolin <barmar@alum.mit.edu> - 2015-08-10 02:07 -0500
Re: cron as root csampson@inetworld.net (Charles H. Sampson) - 2015-08-10 17:44 -0700
Re: cron as root Leonard Blaisdell <leoblaisdell@sbcglobal.net> - 2015-08-10 19:39 -0700
Re: cron as root Warren Oates <warren.oates@gmail.com> - 2015-08-11 07:49 -0400
Re: cron as root Barry Margolin <barmar@alum.mit.edu> - 2015-08-03 11:11 -0400
Re: cron as root csampson@inetworld.net (Charles H. Sampson) - 2015-08-09 12:29 -0700
Re: cron as root Jolly Roger <jollyroger@pobox.com> - 2015-08-09 22:23 +0000
Re: cron as root csampson@inetworld.net (Charles H. Sampson) - 2015-08-10 00:01 -0700
csiph-web