3 ms·
Here are some more useful options: * "-C" to exclude all common revision-control working directory files. Lowest filter priority, consider the rest of your arg
by peterwwillis 17y ago
Here are some more useful options:
* "-C" to exclude all common revision-control working directory files. Lowest filter priority, consider the rest of your args.
* Look up backup rsync guides and add snapshot or "--backup-dir" support to your deploys for a cheap alternative to system snapshots and other deployment reversion techniques.
* "-E" and "-X" for when you just want to apply execute settings and not blow away whatever custom permissions you may have on your deployed files ("--chmod" is also helpful here)
* "--delete-after" and "--delete-excluded" to clean up files you've deleted from your source files.
* "--timeout=120 --contimeout=60" Because nobody needs to wait 5 minutes to find out their deploy failed.
* "--compress-level=9"
* If you have a huge deploy tree, it may be faster (though less reliable) to run
find SRC -mtime -8 -print0 > files.txt && rsync OPTIONS --from0 --files-from files.txt DEST
This will make a list of only the past 7 days' worth of modified files to attempt to rsync, which may cut down on the total time to deploy considerably.
* "--log-file=/big/partition/deploy.log" To get a better idea of how the deploy is going or how it went.
* Consider if you need --delay-updates to make the deploy more atomic. If files get deployed a few at a time, will this cause the user experience to suffer? Load as well as long file lists can cause long periods between updates.
* If you have more than one developer that can deploy to the site at the same time, consider that rsync should only be your file-transfer tool. You need a whole other layer to account for transaction locking, who is deploying or reverting files, and basic logging is very handy to track down problems. But that's a bit out of scope for this link :)