Add this shell script to your ~/.bash_profile

*I assume that your vhost path is /var/www/vhost or you can change it to yours

function sync_down() 
{
rsync -avz [email protected]:/var/www/vhosts/$1/htdocs/wp-content/uploads/* /var/www/vhosts/$1/htdocs/wp-content/uploads/
}

function sync_up() 
{
rsync -avz /var/www/vhosts/$1/htdocs/wp-content/uploads/* [email protected]:/var/www/vhosts/$1/htdocs/wp-content/uploads/
}

How to use it?

  • sync_down domainname.com
  • sync_up domainname.com

What can I say, I’m a lazy programmer! :-)