I sorted out some of what I was doing wrong with crontab. Since otrs is a true system user, like apache2 and ssh, it doesn't have a /home folder. I must have been a little tired, using -r instead of -l to display the user's crontab file. :-)<br>
<br>-Wolf<br><br><div class="gmail_quote">On Mon, Aug 8, 2011 at 8:24 AM, Lightner, Jeff <span dir="ltr"><<a href="mailto:JLightner@water.com">JLightner@water.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
You can do it that way but since each user can have its own crontab there's no requirement to do it that way. Running it in the user's crontab avoids the need to run "su - <user>" in the script along with possible attendant ugly output for trying to setup a terminal based session that doesn't apply in background processes. (Not a problem - just makes logging look bad.)<br>
<div class="im"><br>
<br>
<br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:ale-bounces@ale.org">ale-bounces@ale.org</a> [mailto:<a href="mailto:ale-bounces@ale.org">ale-bounces@ale.org</a>] On Behalf Of Jim Lynch<br>
Sent: Sunday, August 07, 2011 4:26 AM<br>
To: Atlanta Linux Enthusiasts<br>
</div><div><div></div><div class="h5">Subject: Re: [ale] cron jobs<br>
<br>
On 08/05/2011 03:22 PM, Lightner, Jeff wrote:<br>
><br>
> Does the user exist in /etc/passwd? (or NIS or LDAP?) crontab -e is<br>
> for editing system users. The message you got suggests the otrs<br>
> "home directory" is /opt/otrs.<br>
><br>
> When you ran crontab -e did you run it as the otrs users or as root?<br>
> (If any other user it would likely fail due to permissions as you saw.)<br>
><br>
> ------------------------------------------------------------------------<br>
><br>
> *From:*<a href="mailto:ale-bounces@ale.org">ale-bounces@ale.org</a> [mailto:<a href="mailto:ale-bounces@ale.org">ale-bounces@ale.org</a>] *On Behalf Of<br>
> *Wolf Halton<br>
> *Sent:* Friday, August 05, 2011 2:52 PM<br>
> *To:* Atlanta Linux Enthusiasts<br>
> *Subject:* [ale] cron jobs<br>
><br>
> I want to do a cron job for otrs user, to check for mail hourly from<br>
> my mail server<br>
> otrs@localhost doesn't have a 'real' home folder, and<br>
> crontab -e saves the file to /tmp<br>
> when I look for my cron job<br>
> crontab -r -u otrs<br>
> it tells me --><br>
><br>
> cannot touch '/opt/otrs//.selected_editor': Permission Denied<br>
><br>
If you need to run a cron as a user, consider putting the command in<br>
/etc/crontab. There you can specify the user the command is run as.<br>
<br>
Jim.<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
<br>
<br>
<br>
</div></div><div class="im">Proud partner. Susan G. Komen for the Cure.<br>
<br>
<br>
Please consider our environment before printing this e-mail or attachments.<br>
<br>
----------------------------------<br>
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.<br>
----------------------------------<br>
<br>
</div><div><div></div><div class="h5">_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
See JOBS, ANNOUNCE and SCHOOLS lists at<br>
<a href="http://mail.ale.org/mailman/listinfo" target="_blank">http://mail.ale.org/mailman/listinfo</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>This Apt Has Super Cow Powers - <a href="http://sourcefreedom.com">http://sourcefreedom.com</a><br>