Copy Scripts

This script copies the contents of the _site directory of the directory to the current directory.

From rsync man docs: archive mode, which ensures that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved in the transfer. Additionally, compression will be used to reduce the size of data portions of the transfer.

  • archive (a) mode; equals -rlptgoD
  • verbose (v) mode
  • preserve (p) permissions
  • display (P) progress
  • dry run (n) mode
  • delete (delete) extraneous files from destination directory or directories.
SITE="/charliecalvert.github.io/_site/"
SOURCE=${GIT_HOME}${SITE}
DEST="./public/"

FLAGS="--archive --verbose --progress --delete"
FLAGS_DRY_RUN="--archive --verbose --progress --dry-run --delete"

# rsync ${FLAGS_DRY_RUN} ${SOURCE} ${DEST}
rsync ${FLAGS} ${SOURCE} ${DEST}