Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I use a script that calls rsync to upload my website from my local machine to the server. Here is an example:</p> <pre><code>rsync -razv --exclude '.svn' --exclude '.settings' --exclude '.buildpath' -e "ssh -l user" --delete ~/workspace/website/ www.example.com:/var/www/ </code></pre> <p>I have to exclude the .svn, .settings, &amp; .buildpath files and folders because I don't want those going on the site. My server would be www.example.com. The path on the server would be /var/www and the user would be "user".</p> <p>The --delete argument tells rsync to delete files on the remote machine that don't exist on the local machine (e.x. files that I removed)</p> <p>I use pub-private key authentication so the script runs without asking for a password. If you wish to use a password you will need to change</p> <p>-e "ssh -l user1"</p> <p>to</p> <p>-e "sshpass -p password ssh -l user"</p> <p>I could imagine you'd do something like this:</p> <pre><code>rsync -razv --exclude '.svn' --exclude '.settings' --exclude '.buildpath' -e "ssh -l user1" --delete ~/workspace/website/ www.server1.com:/var/www/ rsync -razv --exclude '.svn' --exclude '.settings' --exclude '.buildpath' -e "ssh -l user2" --delete ~/workspace/website/ www.server2.com:/var/www/ rsync -razv --exclude '.svn' --exclude '.settings' --exclude '.buildpath' -e "ssh -l user3" --delete ~/workspace/website/ www.server3.com:/var/www/ rsync -razv --exclude '.svn' --exclude '.settings' --exclude '.buildpath' -e "ssh -l user4" --delete ~/workspace/website/ www.server4.com:/var/www/ rsync -razv --exclude '.svn' --exclude '.settings' --exclude '.buildpath' -e "ssh -l user5" --delete ~/workspace/website/ www.server5.com:/var/www/ </code></pre> <p>NOTE: sshpass will need to be installed on local machine if passwords are to be used. Rsync will need to be installed on the local and remote machines.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload