Introduction
In this project, you will learn how to set up a cron job to automatically back up the system's daily log files. As a system administrator, you may frequently need to perform log backups to ensure the availability and recoverability of important system data.
๐ฏ Tasks
In this project, you will learn:
- How to set up a cron job for the "labex" user
- How to create a tar archive of specific log files from the
/var/log
directory
- How to save the backup file in the
/home/labex/project/backup/
directory with a date-based filename
๐ Achievements
After completing this project, you will be able to:
- Automate the daily backup of system log files using a cron job
- Ensure the consistent and reliable backup of critical system logs
- Verify the successful creation of the log backup files
Skills Graph
%%%%{init: {'theme':'neutral'}}%%%%
flowchart RL
linux(("`Linux`")) -.-> linux/SystemInformationandMonitoringGroup(["`System Information and Monitoring`"])
linux(("`Linux`")) -.-> linux/BasicSystemCommandsGroup(["`Basic System Commands`"])
linux(("`Linux`")) -.-> linux/CompressionandArchivingGroup(["`Compression and Archiving`"])
linux(("`Linux`")) -.-> linux/FileandDirectoryManagementGroup(["`File and Directory Management`"])
linux(("`Linux`")) -.-> linux/UserandGroupManagementGroup(["`User and Group Management`"])
shell(("`Shell`")) -.-> shell/BasicSyntaxandStructureGroup(["`Basic Syntax and Structure`"])
shell(("`Shell`")) -.-> shell/AdvancedScriptingConceptsGroup(["`Advanced Scripting Concepts`"])
shell(("`Shell`")) -.-> shell/SystemInteractionandConfigurationGroup(["`System Interaction and Configuration`"])
linux/SystemInformationandMonitoringGroup -.-> linux/crontab("`Job Scheduling`")
linux/BasicSystemCommandsGroup -.-> linux/logical("`Logic Operations`")
linux/CompressionandArchivingGroup -.-> linux/tar("`Archiving`")
linux/FileandDirectoryManagementGroup -.-> linux/mkdir("`Directory Creating`")
linux/UserandGroupManagementGroup -.-> linux/sudo("`Privilege Granting`")
linux/SystemInformationandMonitoringGroup -.-> linux/date("`Date/Time Displaying`")
linux/SystemInformationandMonitoringGroup -.-> linux/service("`Service Managing`")
shell/BasicSyntaxandStructureGroup -.-> shell/comments("`Comments`")
shell/AdvancedScriptingConceptsGroup -.-> shell/cmd_substitution("`Command Substitution`")
shell/AdvancedScriptingConceptsGroup -.-> shell/subshells("`Subshells and Command Groups`")
shell/SystemInteractionandConfigurationGroup -.-> shell/globbing_expansion("`Globbing and Pathname Expansion`")
linux/FileandDirectoryManagementGroup -.-> linux/wildcard("`Wildcard Character`")
subgraph Lab Skills
linux/crontab -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
linux/logical -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
linux/tar -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
linux/mkdir -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
linux/sudo -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
linux/date -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
linux/service -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
shell/comments -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
shell/cmd_substitution -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
shell/subshells -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
shell/globbing_expansion -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
linux/wildcard -.-> lab-301479{{"`Automated Daily System Log Backup`"}}
end