Author Topic: Mail not send on cron run  (Read 362 times)

0 Members and 1 Guest are viewing this topic.

Offline postcd

  • Jr. Member
  • **
  • Posts: 37
  • Karma: 0
  • Gender: Male
  • just curious
    • View Profile
    • Awards
Mail not send on cron run
« on: April 18, 2014, 03:37:44 pm »
Hello, i have an file in /etc/cron.d


Code: [Select]
MAILTO=mymail@gmail.com

*/5 * * * * nobody /usr/sbin/vnstat.cron

i want to ask why im not receiving any emails not into spam folder, nowhere?

File has 644 permissions, root:root
no general writing in my threads please, only helpfull ontopic please

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1549
  • Karma: 122
  • Gender: Male
    • View Profile
    • Awards
Re: Mail not send on cron run
« Reply #1 on: April 18, 2014, 10:04:05 pm »
Is cron running?
Code: [Select]
ps aux | grep cron
Check the log files
Code: [Select]
cat /var/log/cron.log
also what is in crontab?
Code: [Select]
cat /etc/crontab

Offline postcd

  • Jr. Member
  • **
  • Posts: 37
  • Karma: 0
  • Gender: Male
  • just curious
    • View Profile
    • Awards
Re: Mail not send on cron run
« Reply #2 on: April 19, 2014, 02:31:08 pm »
thx, its running and log is running.

this is cat /etc/crontab

Code: [Select]
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

is it wrong, meaning that this mailto override mailto in particular cron files ?
no general writing in my threads please, only helpfull ontopic please

Offline SeZo

  • Hero Member
  • *****
  • Posts: 1549
  • Karma: 122
  • Gender: Male
    • View Profile
    • Awards
Re: Mail not send on cron run
« Reply #3 on: April 19, 2014, 08:06:52 pm »
OK, I rephrase the question:
Is cron running your script?
Simplest is to add some logging into your script, then look in your log files.

Also this will not work if you have not setup an email server.

Offline postcd

  • Jr. Member
  • **
  • Posts: 37
  • Karma: 0
  • Gender: Male
  • just curious
    • View Profile
    • Awards
Re: Mail not send on cron run
« Reply #4 on: April 20, 2014, 02:43:46 pm »
as already said. it is running!
no general writing in my threads please, only helpfull ontopic please

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal