This Bash script automates the process of backing up files from specified remote servers to designated local directories using rsync. It includes logging capabilities for monitoring the backup operations and handles password authentication using sshpass.
declare -A SOURCE_SERVERS=(
["[email protected]:22:/backends"]="password11:/mnt/storage/backup/backends-11"
["[email protected]:2223:/etc/nginx"]="password12:/mnt/storage/backup/nginx-12"
)
ARCHIVE_BASE="/mnt/storage/backup/archive"
LOG_DESTINATION="/mnt/storage/backup"
CURRENT_DATE=$(date +"%Y-%m-%d_%H-%M-%S")rsync and sshpass, it simplifies file transfers while managing passwords securely within a controlled environment. Please leave a comment if you have any comments, suggestions or problems.