Skip to content

Latest commit

 

History

History
56 lines (44 loc) · 878 Bytes

README.md

File metadata and controls

56 lines (44 loc) · 878 Bytes

README

Demonstrate how to setup a cronjob

  1. systemd?
  2. MTA

Test Script

./public_ip.sh
cat /var/log/syslog

Use crontab.guru for easy ways to work out crontab format.

Configure Cron Job (Debian)

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

Remove the crontab entry

crontab -e

Troubleshooting

# view the crontab
crontab -l

# look at the cron service
sudo systemctl status cron  

# rsyslog service
sudo systemctl status rsyslog     

man rsyslogd 
man cron