From fb6f627cb7940091ab0e981c6acf085e852a51ca Mon Sep 17 00:00:00 2001 From: Dante Catalfamo Date: Thu, 18 Jun 2020 19:28:27 -0400 Subject: Add --delete to rsync options --- content/posts/how-this-blog-works.org | 4 +++- deploy.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/content/posts/how-this-blog-works.org b/content/posts/how-this-blog-works.org index 087c1ed..80fa1ca 100644 --- a/content/posts/how-this-blog-works.org +++ b/content/posts/how-this-blog-works.org @@ -199,7 +199,7 @@ it works. cd '$(dirname "$0")' hugo - rsync -va --progress --rsync-path="/usr/bin/openrsync" public/ blog@lambda.cx:/var/www/htdocs/lambda.cx/blog + rsync -va --progress --delete --rsync-path="/usr/bin/openrsync" public/ blog@lambda.cx:/var/www/htdocs/lambda.cx/blog #+END_SRC Going through it line by line: @@ -219,6 +219,8 @@ it works. - =-a= Stands for "archive": copy recursively, keep permissions, etc. See the =rsync= man page if you're curious. - =--progress= Show progress, also optional + - =--delete= Removed files on the server that no longer exist on + the client - ~--rsync-path="/usr/bin/openrsync"~ This line is very important for OpenBSD servers. OpenBSD has its own =rsync= implementation called =openrsync=. Without this argument, =rsync= will connect diff --git a/deploy.sh b/deploy.sh index bcac598..4cdeb3e 100755 --- a/deploy.sh +++ b/deploy.sh @@ -4,4 +4,4 @@ set -e cd "$(dirname "$0")" git submodule update --init hugo -rsync -va --progress --rsync-path="/usr/bin/openrsync" public/ blog@lambda.cx:/var/www/htdocs/blog.lambda.cx/ +rsync -va --progress --delete --rsync-path="/usr/bin/openrsync" public/ blog@lambda.cx:/var/www/htdocs/blog.lambda.cx/ -- cgit v1.2.3