More tips on using rsync to deploy your website
My post on deploying a website using rsync has gotten quite a few hits.
I thought I'd add some more tips:
- use the "--delete" option if you want to delete files on the destination directory that no longer exist in the source directory.
- add "$1" after your options like this: > rsync -rvz$1 Then you can easily do a DRY RUN. Just type:
./deploy.sh n
The n will get substituted for $1.
Troubleshooting
I've found a lot of times rsync appears to be copying the same files over and over.
There are a few things you can do to troubleshoot when rsync recopies the same files.
The options that I've found come in real handy are:
- The i option, which shows you why a file is being copied (all pluses means rsync thinks it doesn't exist in the destination; t means the times differ; s means the contents differ (?)).
- The --modify-window=1 option. This lets you ignore differences in modified timestamps. You can set 1 to a high number to ignore large differences.
Posted 03/03/2010
blog comments powered by Disqus