Tag Archives: crontab

Where is the cron / crontab log? / How to enable the Cron Log?

1. modify rsyslog config: open /etc/rsyslog.d/50-default.conf,remove # before cron.*

pico /etc/rsyslog.d/50-default.conf
Code language: JavaScript (javascript)
[quote] # Default rules for rsyslog. # # For more information see rsyslog.conf(5) and /etc/rsyslog.conf # # First some standard log files. Log by facility. # auth,authpriv.* /var/log/auth.log *.*;auth,authpriv.none -/var/log/syslog cron.* /var/log/cron.log #daemon.* -/var/log/daemon.log kern.* -/var/log/kern.log #lpr.* -/var/log/lpr.log mail.* -/var/log/mail.log #user.* -/var/log/user.log
Code language: PHP (php)

2. chown syslog:admin cron.log

3. restart rsyslog service: sudo service rsyslog restart

sudo service rsyslog restart

4. restart cron service: service cron restart

service cron restart

Now you can check cron log from file cat /var/log/cron.log

Hddtemp crontab every hour in to file

hddtemp is a small utility (with daemon) that gives the hard-drive temperature via S.M.A.R.T. (for drives supporting this feature).
In this article we are going to create a txt file and in it we are going to store the hdd temperature for every hour.

apt-get install hddtemp

crontab -e
* * * * echo `date`,`/usr/sbin/hddtemp /dev/sda` >> /root/hddtemp.txt
pico /root/hddtemp.txt

tail -f /root/hddtmep.txt