Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Below are cron scripts. These do not run. Cron logs shows it is activated. fetchmail.cron is in /etc/cron.hourly and if 'run-parts /etc/cron.hourly' is run the scripts run. Also scripts in cron.daily appear to run.
Thanks - Dan
cat of crontab:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
run-parts is a script that will run other programs in a single directory. Your fetchmail.cron script should run twice. Via run-parts and your second entry "05 * * * * root /etc/cron.hourly/fetchmail.cron".
Are there any scripts in /etc/cron.weekly or /etc/cron.monthly directories? If not then there is nothing to run.
Fetchmail runs as a daemon - ie it can stay running once started so why not use that feature and put a mail-checking frequency in your .fetchtmailrc rather than using cron?
Thanks for the suggestion, however the script is still not working. Is there a way to create a detailed log? Cron log simply shows the script as being run. There is no error.
fetchmail: WARNING: Running as root is discouraged.
fetchmail: can't find a password for root@1.
fetchmail: WARNING: Running as root is discouraged.
fetchmail: can't find a password for root@1.
fetchmail: WARNING: Running as root is discouraged.
fetchmail: can't find a password for root@1.
Where does the password come from? The script runs when called from a bash shell. It gets the above error from cron. Is there a password associated with cron?
The password seems to be the email login pass for root@1 which it thinks is the pop3 account to check. There are a few problems running programs with cron that use environmental variables. Usually you need to specify env vars in your script.
Does the script run normal from a bash shell while logged in as as root? Maybe check roots .fetchmailrc? Or maybe you need to copy .fetchmailrc to /etc/fetchmailrc to make it global.
I have always run fetchmail from my user account, I would suggest doing that and using the daemon feature though.
This did not create a change. Below is the updated crontab. The scripts in cron.daily run. The script runs successfully as user 'buffer' with /home/buffer/fetchmail.cron
Here it is. The script runs. I may try putting it in the daily. There is a script there that runs.
cat .fetchmailrc
defaults proto pop3
poll mail.xxx.com:
user dansawyer, fetchall, password xxxx is buffer here;
poll server.sawyer.home proto auto:
user buffer, keep, fetchall, password xxxxx, is dansawyer here;
poll server.sawyer.home proto auto:
user buffer, keep, fetchall, password xxxxx, is test here;
poll server.sawyer.home proto auto:
user buffer, keep, fetchall, password xxxxx, is netscape here;
poll server.sawyer.home proto auto:
user buffer, keep, fetchall, password xxxxx, is dan here;
poll server.sawyer.home proto auto:
user buffer, keep, fetchall, password xxxxx, is portable here;
poll server.sawyer.home proto auto:
user buffer, fetchall, password xxxxx, is laura here;
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.