View previous topic :: View next topic |
Author |
Message |
albright Advocate
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Fri Nov 21, 2014 3:11 pm Post subject: cron question |
|
|
I use cronie and was under the impression that if I put a
line in /etc/crontab like this:
1 * * * * wesi72600 /usr/bin/offlineimap
then at 1 minute after every hour offlineimap will run AS USER wesi72600
but I just got an error from offlineimap that a config file was missing
from ROOT's home directory
Obviously, I do not understand how cronie / cron is working.
Any advice would be appreciated. _________________ .... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme) |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9679 Location: almost Mile High in the USA
|
Posted: Fri Nov 21, 2014 5:15 pm Post subject: |
|
|
I don't know much about cronie, but classic vixie-cron does not support changing users directly (the "do one thing and do it well" mantra) - so you do this by using su -c as a part of the command line in crontab.
However you have to keep in mind that you may need the script to change directories before running.
Or of course you can put it in that user's crontab file. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
steveL Watchman
Joined: 13 Sep 2006 Posts: 5153 Location: The Peanut Gallery
|
Posted: Fri Nov 21, 2014 5:50 pm Post subject: |
|
|
eccerr0r wrote: | Or of course you can put it in that user's crontab file. |
That's the best choice, yeah:
Code: | crontab -u apache -e | for example. |
|
Back to top |
|
|
albright Advocate
Joined: 16 Nov 2003 Posts: 2588 Location: Near Toronto
|
Posted: Fri Nov 21, 2014 6:30 pm Post subject: |
|
|
thanks for the advice, which is good
but ... the problem was that offlineimap for reasons I do not
understand required its config file to be at / so I misunderstood
the message
cronie can run jobs as particular users without problem
I am the idiot _________________ .... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme) |
|
Back to top |
|
|
|