Skip to content

Bash script to archive system log files and measure execution time.

License

Notifications You must be signed in to change notification settings

omyldrm/linux-log-archiver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

linux-log-archiver

A simple Bash script that archives the /var/log directory and stores the compressed file in a chosen destination directory.

This script was written as a learning exercise while studying Linux and Bash scripting as a first-year Applied Computer Science student.

What the Script Does

  • Archives the /var/log directory into a .tgz file
  • Saves the archive in a specified directory (default: /tmp)
  • Requires root privileges
  • Measures and displays the execution time
  • Logs tar errors to a file in /tmp

Usage

Make the script executable: chmod +x log-backup.sh Run the script as root: sudo ./log-backup.sh [destination_directory]

If no destination directory is provided, /tmp is used by default.

Technologies Used

  • Bash, Linux, tar

Notes

  • The script must be run as root to access /var/log
  • The destination directory must be writable
  • This script is intended for educational purposes

About

Bash script to archive system log files and measure execution time.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages