LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-31-2010, 02:45 PM   #1
banditman
LQ Newbie
 
Registered: May 2010
Posts: 17
Blog Entries: 1

Rep: Reputation: 1
cron and crontab help


Hi I am trying to setup a cron job using crontab entry like this
6,16,26,36,46,56 * * * * /usr/bin/fetchmail -k>/dev/null 2>&1

But nothing is happening
This is the first time I have attempted using cron as I have settup mutt for my email which is now working great but I would like to have the mail collected every 10 mins

The file is saved as mailcron in my /home folder.

When i run crontab -l its listed ok but no mail is appearing in mutt.
 
Old 05-31-2010, 03:31 PM   #2
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
Have you tried directing the output to a file, rather than sending it to /dev/null, and checking if that gives any clues?
 
Old 05-31-2010, 03:36 PM   #3
banditman
LQ Newbie
 
Registered: May 2010
Posts: 17

Original Poster
Blog Entries: 1

Rep: Reputation: 1
Quote:
Originally Posted by Robhogg View Post
Have you tried directing the output to a file, rather than sending it to /dev/null, and checking if that gives any clues?
I wanted the emails to show up in Mutt which it does if I issue the command /usr/bin/fetchmail -k the /dev/null was added to stop being sent a confirmation message every 10 mins

all I need is for crontab to fetch my email to mutt every 10 mins instead of me manually issuing the command /usr/bin/fetchmail -k all the time
 
Old 05-31-2010, 04:14 PM   #4
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 841Reputation: 841Reputation: 841Reputation: 841Reputation: 841Reputation: 841Reputation: 841
Code:
*/10 * * * * /usr/bin/fetchmail -k &>/dev/null
is probably nicer...
 
Old 05-31-2010, 04:32 PM   #5
Robhogg
Member
 
Registered: Sep 2004
Location: Old York, North Yorks.
Distribution: Debian 7 (mainly)
Posts: 653

Rep: Reputation: 97
Quote:
Originally Posted by banditman View Post
I wanted the emails to show up in Mutt which it does if I issue the command /usr/bin/fetchmail -k the /dev/null was added to stop being sent a confirmation message every 10 mins
The problem is that, without any output, it's difficult to work out what's going wrong.

If you send the output to a file, I believe you still won't get the confirmation message, but the file might show why it isn't working, e.g.:

Code:
6,16,26,36,46,56 * * * * /usr/bin/fetchmail -k>>/var/tmp/fetchmail.cron 2>&1

Last edited by Robhogg; 05-31-2010 at 04:33 PM.
 
Old 05-31-2010, 05:15 PM   #6
banditman
LQ Newbie
 
Registered: May 2010
Posts: 17

Original Poster
Blog Entries: 1

Rep: Reputation: 1
Hoping its working ok now with /usr/bin/fetchmail -k -m "/usr/bin/procmail -d %T" added it should be passing the emails through procmail to reach mutt will let you know in 10 mins
 
Old 05-31-2010, 05:31 PM   #7
banditman
LQ Newbie
 
Registered: May 2010
Posts: 17

Original Poster
Blog Entries: 1

Rep: Reputation: 1
Smile

Quote:
Originally Posted by Robhogg View Post
Have you tried directing the output to a file, rather than sending it to /dev/null, and checking if that gives any clues?
when I looked in the fetchmail.log file it was fetching all the messages but just needed passing to procmail for sorting so now its working well many thanks for all the suggestions
 
Old 05-31-2010, 05:43 PM   #8
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 231Reputation: 231Reputation: 231
@banditman - it would help all forum users if you would mark this thread as solved via the thread tools menu (I think thats where it is).
 
Old 05-31-2010, 05:47 PM   #9
banditman
LQ Newbie
 
Registered: May 2010
Posts: 17

Original Poster
Blog Entries: 1

Rep: Reputation: 1
Will do thanks
 
Old 05-31-2010, 05:48 PM   #10
banditman
LQ Newbie
 
Registered: May 2010
Posts: 17

Original Poster
Blog Entries: 1

Rep: Reputation: 1
Ok will do thanks
 
Old 05-31-2010, 05:52 PM   #11
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 231Reputation: 231Reputation: 231
@banditman - cool, nice one for that it helps users when searching posts to possibly help with. Thanks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab -e vs /etc/cron.* rosv Debian 1 09-16-2008 07:39 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 AM
crontab vs cron.daily ? SheldonPlankton Linux - Newbie 1 07-16-2004 12:10 PM
Cron/Crontab Question cmfarley19 Linux - General 2 04-09-2003 01:09 PM
Cron/Crontab loocw Linux - General 2 03-08-2001 02:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration