Before you start
Learn what these tutorials can teach you and how you can get the most from them.
The Linux Professional Institute (LPI) certifies Linux system administrators at junior and intermediate levels. To attain each level of certification, you must pass two LPI exams.
Each exam covers several topics, and each topic has a weight. The weights indicate the relative importance of each topic. You can expect more questions on the exam for topics with higher weight. The topics and their weights for LPI exam 201 are:
- Topic 201
- Linux kernel (weight 5).
- Topic 202
- System startup (weight 5).
- Topic 203
- Filesystem (weight 10).
- Topic 204
- Hardware (weight 8).
- Topic 209
- File and service sharing (weight 8).
- Topic 211
- System maintenance (weight 4).
- Topic 213
- System customization and automation (weight 3). The focus of this tutorial.
- Topic 214
- Troubleshooting (weight 6).
The Linux Professional Institute does not endorse any third-party exam preparation material or techniques. For details, please contact info@lpi.org.
Welcome to "System customization and automation," the seventh of eight tutorials designed to prepare you for LPI exam 201. In this tutorial, you learn several basic approaches to scripting and automating system events, such as report and status generation, clean up, and general maintenance.
The tutorial is organized according to the LPI objectives for this topic:
- 2.213.1 Automating tasks using scripts (weight 3)
- You will be able to write simple Perl scripts that make use of modules where appropriate, use the Perl taint mode to secure data, and install Perl modules from Comprehensive Perl Archive Network (CPAN). This objective includes using sed and awk in scripts, as well as using scripts to check for process execution and generating alerts by e-mail or pager when a process dies. You should be able to write and schedule automatic execution of scripts to parse logs for alerts and e-mail them to administrators, synchronize files across machines using rsync, monitor files for changes and generate e-mail alerts, and write a script that notifies administrators when specified users log in or out.
One of the task categories a system administrator must perform is to automate events that need to occur periodically and to efficiently handle other events that occur sporadically. For automatic scheduling, your primary tools are cron and at. Tasks, whether regularly scheduled or manually launched, can be scripted with various languages, including bash, awk, Perl, or Python. Tools in the GNU text utilities are often useful as part of many processing tasks; these are most often used within bash scripts since more sophisticated languages like awk, Perl, and Python build in most of the capabilities in the text utilities.
To get the most from this tutorial, you should have a basic knowledge of Linux and a working Linux system on which you can practice the commands covered in this tutorial.


