fetchmail daemon
Hi all,
I might be going about this all the wrong way. I added 'fetchmail -d 600' to the bottom of my /etc/profile file with the goal of having my mail automatically checked every ten minutes. This works fine. However, obviously if there is a second login on the same machine fetchmail moans (can't have daemon running twice). Is there a better way to get the fetchmail daemon to run on its own? Maybe I could write a code to check if fetchmail -d is running and if not start it. I can't think how I'd go about this. Any help would be much appreciated. Chris |
Try adding this to your system startup script (rc.local, or something, depends on your distro):
fetchmail -f /path/to/your/.fetchmailrc |
Sorry it's taken me ages to reply!
That didn't seem to do anything. I did manage to write a script though and I'm quite satisfied with that. Thanks for the help. C |
Another thing you can do is have a cron job to run fetchmail every 10 minutes. This is mine for running it every 5 minutes:
*/5 * * * * /usr/bin/fetchmail >/dev/null 2>&1 This line just goes in your user's crontab. I had tried kotnik's suggestion myself, but this didn't work as it meant running fetchmail as root and I got an error/warning message saying not to do that. |
What about:
su username -c fetchmail (Didn't try it, just a guess) |
Surely you couldn't do that in a startup script, as you'd need to enter your user's password?
|
No, you don't need user's password, if you su-ing from root (as startup scripts are executed as root).
|
All times are GMT -5. The time now is 02:53 AM. |