Skip to content

Instantly share code, notes, and snippets.

@JamesMcMahon
Last active November 1, 2021 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamesMcMahon/4e410e97ed688e4c969fd2983ce4e2b6 to your computer and use it in GitHub Desktop.
Save JamesMcMahon/4e410e97ed688e4c969fd2983ce4e2b6 to your computer and use it in GitHub Desktop.
Remote backup Rsync
#!/usr/bin/env bash
set -e
log_file=$1
local_path=$2
remote_path=$3
time rsync --archive --verbose --new-compress --human-readable --protect-args --progress --exclude=.DS_Store --log-file=rsync_${log_file}.log ${local_path} ${remote_path}
time rsync --checksum --archive --verbose --new-compress --human-readable --protect-args --progress --exclude=.DS_Store --log-file=rsync_${log_file}_checksum-verify.log ${local_path} ${remote_path}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment