Skip to content

Instantly share code, notes, and snippets.

@davemac
Created May 20, 2019 02:13
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 davemac/0549072872728fee8901705d9d3da429 to your computer and use it in GitHub Desktop.
Save davemac/0549072872728fee8901705d9d3da429 to your computer and use it in GitHub Desktop.
rsyncs WordPress uploads directory from staging/prod to current site, excluding .pdf files
# rsync wp uploads directory from staging to current site, exclude .pdf files
# uses command line argument $1 for prod or staging ssh alias
getups() {
current=${PWD##*/}
cd ~/Sites/$current/wp-content/uploads || return
rsync -avzW --progress --exclude '*.pdf' --exclude '*.docx' $current-$1:~/www/wp-content/uploads/* .
cd ~/Sites/$current/wp-content/themes/$current
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment