LINUX PROJECT · ABOUT 30 MIN · +150 XP
Server health report
Your team lead wants a quick health report for the production fleet before Friday's deploy. Everything you need is on this machine: the server inventory in ~/servers.csv, the nginx log in /var/log/nginx/access.log and the app log in /var/log/app/app.log.
Your tasks
- Create ~/ops with two folders inside it: reports and backup.
- Save the names of all prod servers (from ~/servers.csv), one per line, in ~/ops/reports/prod-servers.txt.
- Save every ERROR line from /var/log/app/app.log in ~/ops/reports/app-errors.log.
- Write the number of HTTP 500 responses in the nginx log into ~/ops/reports/http-500.txt (just the number).
- Make ~/ops/reports/app-errors.log readable and writable by you, readable by your group, and nothing for others (rw-r-----).
- Create a gzip tar archive ~/ops/backup/logs.tar.gz containing a copy of access.log (copy it into ~/ops/backup first, then archive it from that folder).
Stuck? Every step is covered in the Linux lessons.