Created
November 25, 2023 14:51
-
-
Save dgacitua/c322b04505f304bb06dce86a52e8d597 to your computer and use it in GitHub Desktop.
Bash script to backup a mounted external drive to local folder
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 | |
set -e | |
SOURCE="/media/dgacitua/DGACITUA-SSD/" # Mounted external drive path (including trailing slash) | |
DESTINATION="/home/dgacitua/rsync-backup" # Local folder where the data is copied (without trailing slash) | |
mkdir -p $DESTINATION | |
rsync -azuvhP --delete --exclude="node_modules" --iconv=. $SOURCE $DESTINATION # Making backup with RSync | |
set +e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment