[ale] cron jobs

Lightner, Jeff JLightner at water.com
Mon Aug 8 08:24:21 EDT 2011


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.)





-----Original Message-----
From: ale-bounces at ale.org [mailto:ale-bounces at ale.org] On Behalf Of Jim Lynch
Sent: Sunday, August 07, 2011 4:26 AM
To: Atlanta Linux Enthusiasts
Subject: Re: [ale] cron jobs

On 08/05/2011 03:22 PM, Lightner, Jeff wrote:
>
> Does the user exist in /etc/passwd?  (or NIS or LDAP?)   crontab -e is
> for editing system users.   The message you got suggests the otrs
> "home directory" is /opt/otrs.
>
> When you ran crontab -e did you run it as the otrs users or as root?
> (If any other user it would likely fail due to permissions as you saw.)
>
> ------------------------------------------------------------------------
>
> *From:*ale-bounces at ale.org [mailto:ale-bounces at ale.org] *On Behalf Of
> *Wolf Halton
> *Sent:* Friday, August 05, 2011 2:52 PM
> *To:* Atlanta Linux Enthusiasts
> *Subject:* [ale] cron jobs
>
> I want to do a cron job for otrs user, to check for mail hourly from
> my mail server
> otrs at localhost doesn't have a 'real' home folder, and
> crontab -e saves the file to /tmp
> when I look for my cron job
> crontab -r -u otrs
> it tells me -->
>
> cannot touch '/opt/otrs//.selected_editor': Permission Denied
>
If you need to run a cron as a user, consider putting the command in
/etc/crontab.  There you can specify the user the command is run as.

Jim.
_______________________________________________
Ale mailing list
Ale at ale.org
http://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo



Proud partner. Susan G. Komen for the Cure.


Please consider our environment before printing this e-mail or attachments.

----------------------------------
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.
----------------------------------



More information about the Ale mailing list