Skip to content

Instantly share code, notes, and snippets.

@davemac
Created March 1, 2018 04:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davemac/944124d1361fea19ec873020ba758f9a to your computer and use it in GitHub Desktop.
Save davemac/944124d1361fea19ec873020ba758f9a to your computer and use it in GitHub Desktop.
rsync wp-content directories up and down
# 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/* .
}
pushups() {
current=${PWD##*/}
cd ~/Sites/$current/wp-content/uploads || return
rsync -avzW --progress . $current-$1:~/www/wp-content/uploads/*
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment