2 Job Scheduling And Service Management

Network and System Administration · Unit 2

Job Scheduling and Service Management

Exam-focused notes for Job Scheduling and Service Management (Network and System Administration, BIT451): what the TU syllabus asks and how it has actually been tested, with 3 solved past questions from this unit.

Job Scheduling and Service Management in short

Servers must run some jobs on a fixed schedule, such as backups and log cleaning. They also must start and stop network services in a controlled way. This chapter covers the tools used for both tasks.

Job Scheduling and Service Management: notes

Cron and Crontab job scheduling

Cron is a background program (daemon) that runs commands at set times. Crontab is the table file that lists the jobs for each user. Edit your own table with crontab -e, list it with crontab -l and remove it with crontab -r.

Each line has five time fields and then the command.

# minute hour day-of-month month day-of-week command
30 2 * * * /usr/local/bin/backup.sh
*/15 * * * * /usr/bin/php /var/www/cron.php
0 9 * * 1-5 /usr/bin/report.sh
0 0 1 * * /usr/sbin/logrotate /etc/logrotate.conf
  • Minute is 0 to 59, hour is 0 to 23, day of month is 1 to 31, and month is 1 to 12.
  • Day of week is 0 to 7, where 0 and 7 are Sunday.
  • * means every value, , makes a list, - makes a range, and / gives a step.

The first job runs every day at 2:30 AM. The second runs every 15 minutes. The third runs at 9:00 AM from Monday to Friday. The fourth runs on the first day of each month.

System jobs are kept in /etc/crontab and /etc/cron.d/. The folders /etc/cron.daily, /etc/cron.weekly and /etc/cron.monthly hold scripts that run on those periods. Access is controlled by /etc/cron.allow and /etc/cron.deny.

What this unit covers

  • Cron and Crontab job scheduling
  • Anacron scheduling and purposes
  • Difference between Cron and Anacron
  • Xinetd and Inetd services
  • Service management and configuration

Difference between Cron and Anacron

2082 · 5 marks

Differentiate between cron and anacron. What are the purposes of anacron? [5]

Feature Cron Anacron ------------------------ System Type Daemon process; runs continuously One-time execution program Startup Requirement Requires system to be running at scheduled time Does not require system to be running at scheduled time Execution Guarantee If system is down at scheduled tim...

Open this answer on its own page →

Cron and Crontab job scheduling

2081 · 10 marks

Explain job scheduling with Cron and Crontab. Briefly explain about Linux server installation.[10]

Cron is a time-based job scheduler in Unix/Linux systems that automatically executes tasks (commands or scripts) at specified intervals without manual intervention. - Runs in the background as a daemon process - Executes jobs at predetermined times - Ideal for repetitive tasks like backups, log r...

Open this answer on its own page →

Xinetd and Inetd services

2082.1 · 5 marks

What is the difference between Xinetd and Inetd services? [5]

Show solved answer

Difference between Xinetd and Inetd Services

Overview

Both inetd and xinetd are internet super-servers that manage network services on Unix/Linux systems, but they differ significantly in architecture, functionality, and performance.


Key Differences

AspectInetdXinetd
GenerationOlder, traditional super-serverNewer, enhanced replacement
ConfigurationSingle /etc/inetd.conf fileMultiple files in /etc/xinetd.d/ directory
Service ManagementSpawns process for each connectionCan limit connections and manage resources
Access ControlLimited built-in security featuresAdvanced access control lists (ACLs)
LoggingBasic syslog supportEnhanced logging capabilities
PerformanceLess efficient under heavy loadBetter resource management
FlexibilityRigid configurationMore configurable and flexible

Detailed Differences

1. Architecture & Design

  • Inetd: Monolithic design; reads single configuration file at startup
  • Xinetd: Modular design; reads configuration from directory allowing per-service configuration

2. Connection Handling

  • Inetd: Spawns a new process for every incoming connection without resource limits
  • Xinetd: Can limit concurrent connections, implement rate limiting, and manage resource allocation per service

3. Security Features

  • Inetd: Minimal access control
  • Xinetd: Supports:
    • IP-based access control
    • Time-based service availability
    • Connection rate limiting
    • Service binding to specific interfaces

4. Configuration Flexibility

  • Inetd: Single file format; difficult to manage many services
  • Xinetd: Separate configuration files per service; easier maintenance and scalability

Conclusion

Xinetd is the modern successor to inetd, offering superior resource management, security, and flexibility, making it the preferred choice for contemporary Linux systems.

Open this answer on its own page →