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/sitename.com/public_html/wp-content/plugins
  • 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/sitename.com/public_html/wp-content/plugins/plugin-name/*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!

Resources

http://devblog.virtage.com/2013/01/to-trailing-slash-or-not-to-trailing-slash-to-rsync-path/ http://qdosmsq.dunbar-it.co.uk/blog/2013/02/rsync-to-slash-or-not-to-slash/


comments powered by Disqus