Demonstrate how to setup a cronjob
- systemd?
- MTA
./public_ip.sh
cat /var/log/syslog
Use crontab.guru for easy ways to work out crontab format.
Uncomment the log source for cron and restart services
nano /etc/rsyslog.d/50-default.conf
sudo service cron restart
sudo service rsyslog restart
Set up a basic frequent cron to test mechanism
crontab -e
* * * * * $(pwd)/public_ip.sh
cat /var/log/cron.log
Then hourly on the hour
crontab -e
0 * * * * $(pwd)/public_ip.sh
cat /var/log/cron.log
crontab -e
# view the crontab
crontab -l
# look at the cron service
sudo systemctl status cron
# rsyslog service
sudo systemctl status rsyslog
man rsyslogd
man cron