-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
use-rsync-to-deploy-your-website.scroll
42 lines (27 loc) · 1.23 KB
/
use-rsync-to-deploy-your-website.scroll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
date 2009-11-21
tags index
permalink use-rsync-to-deploy-your-website.html
title Use rsync to deploy your website
pageHeader.scroll
`rsync` is a nifty little tool that can deploy a website to a testing or production server.
Here's a one line command to deploy brecksblog:
code
rsync -arvuz /home/user/brecksblog breck32@breckyunits.com:/var/www/html/ --exclude '.git' --exclude 'deploy' --exclude 'README' --exclude 'posts.php'
This one line will do a fast, incremental file transfer from my local directory to the web server.
I saved this file as "deploy", and then run it by typing:
code
./deploy
The exclude option will exclude a file or directory from being synced.
Here's an explanation about the options I use. I use rsync with these options:
https://ubuntuforums.org/showthread.php?t=251516 explanation
code
rsync -arvuz /src/foo/ /dest/foo
This will copy the contents of /src/foo/ into /dest/foo. Options explained:
- a: archive mode (keep owner and permissions)
- r: recurse into directories
- v: increase verbosity
- u: update only (don't overwrite newer files - if you have edited files in destination)
- z: compress file data
# Notes
1. If you are using a different port for SSH, say 333 do this: --rsh="ssh -p333"
footer.scroll