Skip to content

Instantly share code, notes, and snippets.

@vst
Last active August 29, 2015 13:57
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 vst/9520867 to your computer and use it in GitHub Desktop.
Save vst/9520867 to your computer and use it in GitHub Desktop.
Creates a folder named `CRAN` in the same folder as this script and mirrors/syncs master CRAN repository to the `CRAN` folder.
#!/bin/bash
## **Description:** Creates a folder named `CRAN` in the same folder
## as this script and mirrors/syncs master CRAN repository to the
## `CRAN` folder.
# Get the script path:
SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
# Get the mirror path:
MIRRORDIR="/CRAN"
MIRRORPATH=${SCRIPTPATH}${MIRRORDIR}
# Notify:
echo "Using '${MIRRORPATH}' as destination to mirror the CRAN"
# Mirror/Sync:
rsync -rtlzv --delete cran.r-project.org::CRAN "${MIRRORPATH}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment