Replies: 1 comment 5 replies
-
Sadly it isn't as straightforward as only building new or updated pages. A few example come to mind:
As a workaround for now, I think you should be able to build the site as normal, then use Really rough experiment: # Setup
$ mkdir {src,dest}
$ echo "hello" > src/{foo,bar,baz}.txt
$ ls -al dest src
dest:
total 0
drwxr-xr-x 2 loic staff 64 Aug 3 17:53 .
drwxr-xr-x 4 loic staff 128 Aug 3 17:53 ..
src:
total 24
drwxr-xr-x 5 loic staff 160 Aug 3 17:54 .
drwxr-xr-x 4 loic staff 128 Aug 3 17:53 ..
-rw-r--r-- 1 loic staff 6 Aug 3 17:54 bar.txt
-rw-r--r-- 1 loic staff 6 Aug 3 17:54 baz.txt
-rw-r--r-- 1 loic staff 6 Aug 3 17:54 foo.txt
# First sync
$ rsync --archive --delete src/ dest
$ ls -al dest src
dest:
total 24
drwxr-xr-x 5 loic staff 160 Aug 3 17:54 .
drwxr-xr-x 4 loic staff 128 Aug 3 17:53 ..
-rw-r--r-- 1 loic staff 6 Aug 3 17:54 bar.txt
-rw-r--r-- 1 loic staff 6 Aug 3 17:54 baz.txt
-rw-r--r-- 1 loic staff 6 Aug 3 17:54 foo.txt
src:
total 16
drwxr-xr-x 4 loic staff 128 Aug 3 17:55 .
drwxr-xr-x 4 loic staff 128 Aug 3 17:53 ..
-rw-r--r-- 1 loic staff 6 Aug 3 17:55 bar.txt
-rw-r--r-- 1 loic staff 13 Aug 3 17:55 foo.txt
# Making some changes
# - Append more test to `foo.txt`
# - Update the "modified time" of `bar.txt` (but the content stay the same)
# - Delete `baz.txt`
$ echo " world" >> src/foo.txt; touch src/bar.txt; rm src/baz.txt
# Now use rsync in dry-run mode to get some information of what rsync would do
$ rsync --archive --delete --checksum --dry-run --itemize-changes src/ dest
*deleting baz.txt
.d..t.... ./
.f..t.... bar.txt
>fcst.... foo.txt We use:
So if the line starts with:
So we can try to save this information to disc, and then run some more scripting magic to clean up the list: $ rsync --archive --delete --checksum --dry-run --itemize-changes src/ dest > rsync.log
$ grep '*deleting' rsync.log | cut -d" " -f2 > file-to-delete.log
$ grep '^>' rsync.log | cut -d" " -f2 > files-to-update.log
$ cat files-to-update.log
foo.txt |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there currently a way to only build pages that are new or updated?
If not, could such a feature be added?
I would like to use a local installation of Wagtail CMS to build static HTML pages to upload to a cheap shared hosting package via FTP. Having to upload all the HTML files would gradually become more of a pain as the site grew larger.
Beta Was this translation helpful? Give feedback.
All reactions