If you have shell access to a machine you can easily use the efficient rsync tool to keep your local copy syncronized with the remotes one. Unluckly many website hosting reseller just provide you with the old outdated FTP and in some rare case WebDAV (FrontPage Extensions).
In this case there is a tool called sitecopy that does the job using both FTP or WebDAV. Its available for everey platform even under Win32 using CygWin.
To configure sitecopy you need to create a config file, under Unix it is .sitecopyrc withing your home directory.
A skeleton configuration is the following:
site MYWEBSITE server www.mywebsite.com protocol ftp ftp nopasv username MYUSERNAME password MYPASSWORD remote ~/htdocs/ local ~/htdocs-mywebsite/ exclude *~
This configuration is very straightforward:
- with site you identify a symbolic name for your configuration, this value will be used later in command line tools.
- protocol can be ftp or dav
- remote will upload the files below that path under the root of your user onto the remote server
- local is the local directory where your website is located, under win32 this will be something like d:/webagency/mywebsite/
- exclude can be used to avoid some files or directories to be uploaded
Using sitecopy is straightforward:
- the first time you use the software: sitecopy -init MYWEBSITE
- to mark the remote site as already up-to-date: sitecopy -catchup MYWEBSITE
- to upload your changed file to the website: sitecopy -update MYWEBSITE
- only list what will be uploaded: sitecopy -list MYWEBSITE
- replace your local copy with the remote: sitecopy -sync MYWEBSITE
- download the list of all the files from the server: sitecopy -fetch MYWEBSITE
If you’re in a company that have a proxy for internet access you can configure some extra parameters into the config file:
proxy-server proxy.company.com proxy-port 3128
when required sitecopy will ask you for the username and password for the proxy.