PERIODIC PROCESS, SYSTEM BACKUPS & LOG FILES

What is a Process?

  • Definition: A process is a term used to refer to any program that runs on a computer.

    • Examples:

      • Background tasks (e.g., spell-checkers, system event handlers)

      • Full-fledged applications (e.g., Microsoft Word)

  • Characteristics of Processes:

    • Created by the Operating System.

    • Can run in two modes:

      • Foreground: Runs on the screen

      • Background: Runs without user interaction

Periodic Processes

  • Definition: Processes that run on an automated schedule.

  • Main Function: Execute system or admin-centered tasks.

  • Tools for Managing Scheduled Processes:

    • Windows: Task Scheduler

    • UNIX/Linux: cron and crontab

Windows Task Scheduler

  • Description: A tool embedded in both client and server versions of Windows OS.

    • Provides a GUI interface for viewing and managing tasks on the OS.

    • Capable of creating custom OS and application-related tasks, including automation of scripts.

Features of Windows Task Scheduler

  • Task Scheduler Interface:

    • Allows creation and management of tasks.

    • Options include:

      • Create Basic Task

      • Create Task

      • Import Task

      • Display All Running Tasks

      • Enable All Tasks History

  • Example Task:

    • GoogleUpdate TaskMachineCore

      • Description: Keeps Google software up to date, critical for fixing vulnerabilities.

      • Security Options:

      • SYSTEM: Tasks run regardless of whether a user is logged on.

      • Log-on requirements can vary (user logged on, or not).

Linux Cron & Crontab

  • Cron: Command-line tool for scheduling in UNIX and Linux OS.

    • Similar function to Windows Task Scheduler.

  • Cron Jobs: Tasks that are automated using Cron.

  • Crontab:

    • Definition: A special text file that defines the schedule of cron jobs.

    • Features: Can be edited manually.

  • Permission Files:

    • cron.allow: Specifies who can edit the crontab file.

    • cron.deny: Specifies who cannot edit the crontab file.

Crontab File Format

  • Format:

    • min hr d/m mon wkday command

  • Example Entries:

    • 45 10 * * 1-5 /root/checkservers

    • 00 12 1 1,5,8 * /root/bkup3

  • Tools for Crontab:

    • Online crontab generators, e.g., Crontab Generator, Cron Maker.

Common Periodic Processes Used by Administrators

  • File system clean-up

  • Log rotation

  • Software installation and persistence

  • Script execution

  • Backups

Backups

  • Definition: The process of copying data to an alternative location to recover it if the original data is lost, corrupted, or inaccessible.

  • Importance: Acts as a safety net for System Administrators.

Backup vs. Redundancy

  • Backup: Protects data availability by ensuring it can still be accessed, even if temporarily inaccessible due to data restoration processes.

  • Redundancy: Aims to prevent any loss of data access from the start.

    • Examples:

      • Mirror databases

      • RAID 1

      • High Availability (HA) systems

      • Hypervisors

On-Premise vs. Remote Backup

  • Backup Media:

    • On-Premise: Stored within the organization's facility.

    • Remote: Stored at a secondary location.

  • Pros and Cons: Based on speed of data access and safety during disasters.

    • On-Premise Pros: Quick backup restores.

    • Remote Pros: Safer in disaster scenarios.

Backup Types

  • Full Backup:

    • Description: Comprehensive backup of all data.

    • Advantage: Minimal restoration time.

    • Disadvantage: Longer execution time.

  • Incremental Backup:

    • Description: Backs up only data that has changed since the last backup.

    • Advantage: Faster and requires fewer resources.

    • Disadvantage: Slowest recovery time.

  • Differential Backup:

    • Description: Copies all data changed since the last full backup.

    • Advantage: Convenient for backing up changed data.

    • Disadvantage: Requires more time and space to complete.

Backup Tools

  • Built-in Tools:

    • Windows: Backup and Restore (client), Windows Server Backup (server).

    • Unix/Linux: Tools like Bacula and Rsync.

  • Third-Party Software:

    • Examples for Windows: Acronis Cyber Backup, Solarwinds Backup.

Best Practices for Backups

  • Plan your backup strategy.

  • Document processes and update regularly.

  • Scope backups based on targets (local systems, cloud devices, mobile).

  • Prioritize systems and essential data.

  • Secure storage and protect on-premise backups.

  • Assess data access (on-premise vs remote storage).

  • Centralize backups to minimize administrative overhead.

  • Test backups to ensure data usability.

  • Choose effective backup tools.

Log Files

  • Definition: Log files are computer-generated data files that contain information regarding usage, operations, and activities within systems.

Important Log Files in Windows OS

  • Log files generated by Windows can include activity from installed applications.

  • Viewing Logs:

    • Built-in tool: Event Viewer

  • Types of Important Log Files:

    • Application: Logs events from applications.

    • Security: Records login attempts, privileges, and audited events.

    • Setup: Logs installation and upgrade messages.

    • System: Contains OS-generated messages.

    • Forwarded Events: Events forwarded to the local machine from other computers.

Important Log Files in Linux OS

  • Overview: Linux generates logs for system activity auditing, located under the /var/log directory.

  • Important Log Files:

    • /var/log/syslog or /var/log/messages: Stores global system activity.

    • /var/log/auth.log or /var/log/secure: Logs security-related events (e.g., logins, root user actions).

    • /var/log/kern.log: Logs kernel events, errors, and warnings.

    • /var/log/cron: Details scheduled tasks (cron jobs) for verification purposes.

Log Management Tools

  • Importance of Log Management: Reading logs manually can be challenging; aggregation of logs is difficult without tools.

  • Log Aggregation: Consolidates log data from various sources into a centralized platform for review and analysis.

  • Tools Used:

    • Log Viewers: Software to enable viewing, merging, sorting, searching, and filtering logs.

      • Examples: Loggly, LogViewer, Gloss, GoAccess.

    • SIEMs: Security Information and Event Management systems; aggregates log data and analyzes events.

      • Examples: Splunk, Solarwinds, LogRhythm, Alien Vault, Graylog, ArcSight.

Conclusion

  • Key Takeaways: Understanding periodic processes, backup types, and log file management is crucial for systems administration.

  • Tools and strategies should be employed to enhance system reliability, data availability, and auditing capabilities.