6/100 Create a Cron Job
The Nautilus
system admins team has prepared scripts to automate several day-to-day tasks. They want them to be deployed on all app servers in Stratos DC
on a set schedule. Before that they need to test similar functionality with a sample cron job.
Tasks:
- Install cronie
package on all Nautilus
app servers and start crond
service.
- Add a cron */5 * * * * echo hello > /tmp/cron_text
for root
user.
ssh tony@stapp01.stratos.xfusioncorp.com
sudo dnf install -y cronie
-- snipped --
Complete!
sudo systemctl start crond
sudo systemctl status crond
● crond.service - Command Scheduler
Loaded: loaded (/usr/lib/systemd/system/crond.service; enabled; preset: enabled)
Active: active (running) since Mon 2025-09-01 13:58:09 UTC; 7min ago
sudo crontab -l
no crontab for root
sudo crontab -e
Copy and paste in:
*/5 * * * * echo hello > /tmp/cron_text
sudo crontab -l
*/5 * * * * echo hello > /tmp/cron_text
Repeat the same process for App 2 and App3