Backing Up Directories and Files with TAR on Linux
This guide explains how to use TAR for backing up files and directories on a Linux system. It also describes how to automate the backup process using scheduled tasks, known as Cron Jobs, and demonstrates how to restore files from a tar.gz archive.
To create a backup using TAR, the command involves specifying various options to ensure the correct settings for the backup process. Key options include creating a new archive file, making the process verbose, preserving file permissions, compressing the archive with gzip, and designating the filename. Additionally, it is possible to automatically include the current date in the filename for better organization.
To restore files from a TAR archive, a different command is used that specifies the extraction process and the target directory for the restored files.
For scheduling backups, the Cron Jobs feature is employed. The crontab file can be edited to set the timing for the backup operations, with specific formats for minute, hour, day, month, and weekday. An example is provided to demonstrate how to schedule a complete system backup at a specific time.
This guide serves as a comprehensive resource for managing backups and restorations of files on a Linux system using TAR and Cron Jobs.
Source Link