Created
March 28, 2022 06:31
-
-
Save ethand91/d164602f1c298178cfb2b51894045a61 to your computer and use it in GitHub Desktop.
Script that backs up directories to an external device.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to backup directories to external disk | |
backup_files="/home /etc /root /boot /opt" | |
backup_location="/mnt/backup" | |
# Create the filename | |
day=$(date +%A) | |
file_name="backup-$day.tgz" | |
tar -Pczf $backup_location/$file_name $backup_files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment