diff --git a/README.md b/README.md index c96ccc51..f8d9e4bf 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,7 @@ turn almost any device into a file server with resumable uploads/downloads using * [reverse-proxy](#reverse-proxy) - running copyparty next to other websites * [browser support](#browser-support) - TLDR: yes * [client examples](#client-examples) - interact with copyparty using non-browser clients + * [folder sync](#folder-sync) - sync folders to/from copyparty * [mount as drive](#mount-as-drive) - a remote copyparty server as a local filesystem * [android app](#android-app) - upload to copyparty with one tap * [iOS shortcuts](#iOS-shortcuts) - there is no iPhone app, but @@ -189,7 +190,7 @@ firewall-cmd --reload * ☑ search by name/path/date/size * ☑ [search by ID3-tags etc.](#searching) * client support - * ☑ [sync folder to server](https://github.com/9001/copyparty/tree/hovudstraum/bin#up2kpy) + * ☑ [folder sync](#folder-sync) * ☑ [curl-friendly](https://user-images.githubusercontent.com/241032/215322619-ea5fd606-3654-40ad-94ee-2bc058647bb2.png) * markdown * ☑ [viewer](#markdown-viewer) @@ -1178,7 +1179,7 @@ interact with copyparty using non-browser clients * `(printf 'PUT / HTTP/1.1\r\n\r\n'; cat movie.mkv) >/dev/tcp/127.0.0.1/3923` * python: [up2k.py](https://github.com/9001/copyparty/blob/hovudstraum/bin/up2k.py) is a command-line up2k client [(webm)](https://ocv.me/stuff/u2cli.webm) - * file uploads, file-search, folder sync, autoresume of aborted/broken uploads + * file uploads, file-search, [folder sync](#folder-sync), autoresume of aborted/broken uploads * can be downloaded from copyparty: controlpanel -> connect -> [up2k.py](http://127.0.0.1:3923/.cpr/a/up2k.py) * see [./bin/README.md#up2kpy](bin/README.md#up2kpy) @@ -1199,6 +1200,15 @@ you can provide passwords using header `PW: hunter2`, cookie `cppwd=hunter2`, ur NOTE: curl will not send the original filename if you use `-T` combined with url-params! Also, make sure to always leave a trailing slash in URLs unless you want to override the filename +## folder sync + +sync folders to/from copyparty + +the commandline uploader [up2k.py](https://github.com/9001/copyparty/tree/hovudstraum/bin#up2kpy) with `--dr` is the best way to sync a folder to copyparty; verifies checksums and does files in parallel, and deletes unexpected files on the server after upload has finished which makes file-renames really cheap (it'll rename serverside and skip uploading) + +alternatively there is [rclone](./docs/rclone.md) which allows for bidirectional sync and is *way* more flexible (stream files straight from sftp/s3/gcs to copyparty for instance), although syncing to copyparty is about 5x slower than up2k.py if you have many small files in particular + + ## mount as drive a remote copyparty server as a local filesystem; go to the control-panel and click `connect` to see a list of commands to do that diff --git a/copyparty/web/svcs.html b/copyparty/web/svcs.html index cb0d87e8..a3ab01d1 100644 --- a/copyparty/web/svcs.html +++ b/copyparty/web/svcs.html @@ -69,7 +69,7 @@ printf '%s\n' "http{{ s }}://{{ ep }}/{{ rvp }} {{ pw }} k" >> /etc/davfs2/secrets printf '%s\n' "http{{ s }}://{{ ep }}/{{ rvp }} mp davfs rw,user,uid=1000,noauto 0 0" >> /etc/fstab -
or you can use rclone instead, which is much slower but doesn't require root:
+or you can use rclone instead, which is much slower but doesn't require root (plus it keeps lastmodified on upload):
rclone config create {{ aname }}-dav webdav url=http{{ s }}://{{ rip }}{{ hport }} vendor=owncloud{% if accs %} user=k pass={{ pw }}{% endif %} rclone mount --vfs-cache-mode writes --dir-cache-time 5s {{ aname }}-dav:{{ rvp }} mp diff --git a/docs/rclone.md b/docs/rclone.md index 75ba5bad..3c20074a 100644 --- a/docs/rclone.md +++ b/docs/rclone.md @@ -14,6 +14,10 @@ when server is on another machine (1gbit LAN), # creating the config file +the copyparty "connect" page at `/?hc` (so for example http://127.0.0.1:3923/?hc) will generate commands to autoconfigure rclone for your server + +**if you prefer to configure rclone manually, continue reading:** + replace `hunter2` with your password, or remove the `hunter2` lines if you allow anonymous access @@ -62,6 +66,17 @@ rclone.exe mount --vfs-cache-mode writes --vfs-cache-max-age 5s --attr-timeout 5 ``` +# sync folders to/from copyparty + +note that the up2k client [up2k.py](https://github.com/9001/copyparty/tree/hovudstraum/bin#up2kpy) (available on the "connect" page of your copyparty server) does uploads much faster and safer, but rclone is bidirectional and more ubiquitous + +``` +rclone sync /usr/share/icons/ cpp-rw:fds/ +``` + +TODO: rclone bug? `--transfers=4` doesn't seem to do anything (it does one request at a time), doesn't matter if the webdav server is copyparty or rclone + + # use rclone as server too, replacing copyparty feels out of place but is too good not to mention @@ -91,3 +106,5 @@ notably, * `hasOCMD5` / `hasOCSHA1` is conveniently dontcare on both ends there's a scary comment mentioning PROPSET of lastmodified which is not something we wish to support + +and if `vendor=owncloud` ever stops working, try `vendor=fastmail` instead