ghdc/backup.sh
2024-10-23 16:30:58 +08:00

10 lines
307 B
Bash

# Navigate to the parent directory of the folder "r"
# Get today's date in the desired format
TODAY=$(date +%Y%m%d)
# Use rsync to copy directory "r" to "r_BACKUP_$TODAY" while excluding the specified directories
rsync -av --exclude 'zip' --exclude 'data' --exclude 'confirmData' . "../r_BACKUP_$TODAY"