From 2f235454bc65b62e2c9e7e9c5fc1533cc84f24ef Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 20 Mar 2026 05:38:03 +0200 Subject: [PATCH] add rsync usage example --- README.md | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4476b8d..59cc057 100644 --- a/README.md +++ b/README.md @@ -32,4 +32,36 @@ RUST_LOG=warn flarumdown -s '/path/to/flarum.sqlite' \ -r http://hc3fycfadz7fkapp62fqi6llioe46fvis6wuswfobl5ghc2u7snq.b32.i2p \ -r http://w6vtcpbir5vvokwdqqbqlrdtnzwyfc4iyqn6owxuyjeppszuydutqwqd.onion ``` -* optionally, delegate `-u` to `rsync` by using `crontab -e` \ No newline at end of file + +### rsync + +Optionally, delegate `-u` to `rsync` by using `crontab -e`: + +``` bash +#!/bin/bash + +mkdir -p /var/www/flarum/public/flarumdown/dump/assets/files + +readonly RSYNC_FILTER_P="*-thumb.webp" +readonly RSYNC_TARGET_D="/var/www/flarum/public/flarumdown/dump/assets" +find "$RSYNC_TARGET_D" -name "$RSYNC_FILTER_P" -type f -delete # rsync has --filter, cleanup matches manually +/usr/bin/rsync -av --delete --filter="-p $RSYNC_FILTER_P" \ + /var/www/flarum/public/assets/files \ + $RSYNC_TARGET_D + +RUST_LOG=warn /usr/local/bin/flarumdown -s /var/www/flarum/flarum.sqlite \ + -t /var/www/flarum/public/flarumdown/dump \ + -i index \ + -r http://[202:68d0:f0d5:b88d:1d1a:555e:2f6b:3148] \ + -r http://[505:6847:c778:61a1:5c6d:e802:d291:8191] \ + -r http://hc3fycfadz7fkapp62fqi6llioe46fvis6wuswfobl5ghc2u7snq.b32.i2p \ + -r http://w6vtcpbir5vvokwdqqbqlrdtnzwyfc4iyqn6owxuyjeppszuydutqwqd.onion + +readonly TARGET_DIR=/var/www/flarum/public/flarumdown/dump +cd "$TARGET_DIR" +if [ "$(pwd)" != "$TARGET_DIR" ]; then + echo "Unexpected path!" + exit 1 +fi +zip -FS -r -9 /var/www/flarum/public/flarumdown/dump.zip . +``` \ No newline at end of file