Dev Notes

Various Cheat Sheets and Resources by David Egan/Carawebs.

rsync Notes- Push a WP Plugin

BASH, Linux, Rsync, Sysadmin, WordPress
David Egan

Use rsync to push a plugin from a local development machine to a remote server.

Sync a Single WP Plugin

Trailing slash or not? That is the question…

rsync -raz -e 'ssh -p 1234' --progress /var/www/localsite/wp-content/plugins/plugin-name user@X.X.X.X:/var/www/
  • No trailing slash on source path: rsync will create the last directory of the path before copying content. In the case above, you’d end up with /var/www/*files.*.
  • Append a trailing slash - rsync will only copy the contents (subdirectories and files) of the source directory directly to the target - Not the directory itself.

I’m always forgetting this - it seems counter-intuitive!


comments powered by Disqus