aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md93
-rw-r--r--docs/ssync-fetch.147
-rw-r--r--docs/ssync-index.148
-rw-r--r--docs/ssync-queue.139
-rw-r--r--docs/ssync.17
-rwxr-xr-xssync1
-rwxr-xr-xssync-queue2
7 files changed, 199 insertions, 38 deletions
diff --git a/README.md b/README.md
index 3b8c72f..e01dd71 100644
--- a/README.md
+++ b/README.md
@@ -44,42 +44,73 @@ In a previous implementation of this - not starting from scratch each run led to
## Configuration
-ssync.conf
-
-```config
-remote_host=HOST
-remote_root_dir=/path/to/sync/root/
-keyfile=/path/to/key
-local_root_dir=/path/to/local/sync/root/
-
-index_window_s=86400 # 24 hours
-index_dir=/path/to/index/dir # optional
-queue_dir=/path/to/queue/dir # optional
-lock_file=/path/to/desired/file.lock # optional
+See `man 5 ssync` for configuration details.
+
+## Usage
+
+There are man pages for each sub-process with details and `-h` flags for each printing the options and configs.
+
+### ssync
+
+```
+ssync [options] CONFIG_FILE
+ OPTIONS
+ -b BACKEND
+ -v verbose logging
+ -h print this message
```
-## commands
+### ssync-index
```
-ssync [options]
- OPTIONS
- -c [CONFIG_FILE] optional config file to use
- default: ~/.config/ssync/ssync.conf
- -l [LOCK_FILE] optional lock file
- default: from config)
- -q [QUEUE_DIR] optional queue dir
- default: from config)
- -k [KEY_FILE] optional key file
- default: from config)
+ssync-index [options] ROOT_DIR
+ OPTIONS
+ -b index basename only
+ -k KEY_FILE (optional: if indexing local)
+ ssh-key file to use (needs to be non-interactive)
+ optional: will use default session key
+ or key set in ssh_config for HOST
+ -o OUTPUT_FILE
+ -r REMOTE_HOST (optional)
+ remote host to index from such as user@hostname
+ username can be omitted if identical to $USER
+ or if set in ssh_config
+ -v verbose logging
+ -w NUM_SECONDS
+ index all files newer than NOW - NUM_SECONDS
+ -h print this message
```
+### ssync-queue
+
+```
+ssync-queue [options] -l LOCAL_INDEX_FILE -r REMOTE_INDEX_FILE -o QUEUE_OUTPUT_FILE
+ OPTIONS
+ -l LOCAL_INDEX_FILE
+ target local index file
+ -r REMOTE_INDEX_FILE
+ target remote index file
+ -o QUEUE_OUTPUT_FILE
+ queue output file
+ -v verbose logging
+ -h print this message
+```
+
+### ssync-fetch
+
```
-ssync-index [options] -c [FILE]
- REQUIRED
- -c [CONFIG_FILE] config file to use
- OPTIONS
- -l local only (cannot be used in conjunction with -r)
- -r remote only (cannot be used in conjunction with -l)
- -o [OUTPUT_FILE] output file override
- -k [KEY_FILE] key file override
+ssync-fetch [options] QUEUE_FILE DEST_DIR
+ OPTIONS
+ -r REMOTE_HOST
+ remote host to download from such as user@hostname
+ username can be omitted if identical to $USER
+ or if set in ssh_config
+ -k KEY_FILE
+ ssh-key file to use (needs to be non-interactive)
+ optional: will use default session key
+ or key set in ssh_config for REMOTE_HOST
+ -b BACKEND
+ sftp (default) | rsync
+ -v verbose logging
+ -h print this message
```
diff --git a/docs/ssync-fetch.1 b/docs/ssync-fetch.1
new file mode 100644
index 0000000..c7cc7ff
--- /dev/null
+++ b/docs/ssync-fetch.1
@@ -0,0 +1,47 @@
+.TH ssync-fetch 1 "December 2025" "2.0.0"
+.SH NAME
+ssync-fetch \- fetch files from queue and write them to a destination.
+.SH SYNOPSIS
+.BR ssync-fetch
+[option...]
+.I QUEUE_FILE
+.I DEST_DIR
+.YS
+.SH OPTIONS
+.TP
+.BI \-b " sftp / rsync"
+Backend used for fetching remote files. Can be
+.MR sftp 1
+or
+.MR rsync 1
+.TP
+.BI \-k " identity_file"
+The
+.BR optional
+identity file used when connecting to remote hosts. See
+.MR ssh 1
+.MR ssh_config 5
+for more information on identity files and configurations.
+.TP
+.BI \-r " hostname"
+Remote Hostname to connect to when indexing and fetching remote files. This should be in the format
+.IR user@hostname
+unless a host alias is set in the users
+.MR ssh_config 5
+.TP
+.BR \-v " verbose logging"
+.TP
+.BR \-h " print this message"
+.SH SEE ALSO
+.MR ssync 1
+.MR ssync 5
+.MR ssync-index 1
+.MR ssync-queue 1
+.SH REPOSITORY
+.UR https://git.senders.io/utils/ssync.git
+.UE
+.SH AUTHORS
+Steph Enders
+.MT steph@senders.io
+.ME
+ssync-fetch is open source licensed under the ISC license. See LICENSE.txt for full copyright information.
diff --git a/docs/ssync-index.1 b/docs/ssync-index.1
new file mode 100644
index 0000000..cb53fc1
--- /dev/null
+++ b/docs/ssync-index.1
@@ -0,0 +1,48 @@
+.TH ssync-index 1 "December 2025" "2.0.0"
+.SH NAME
+ssync-index \- index files locally or remotely
+.SH SYNOPSIS
+.B ssync-index
+.RB [option...]
+.IR ROOT_DIR
+.YS
+.SH OPTIONS
+.TP
+.BR \-b " index basename only"
+.TP
+.BI \-k " identity_file"
+The
+.BR optional
+identity file used when connecting to remote hosts. See
+.MR ssh 1
+.MR ssh_config 5
+for more information on identity files and configurations.
+.TP
+.BI \-o " file"
+File to output to.
+.TP
+.BI \-r " hostname"
+Remote Hostname to connect to when indexing remote files. This should be in the format
+.IR user@hostname
+unless a host alias is set in the users
+.MR ssh_config 5
+.TP
+.BR \-v " verbose logging"
+.TP
+.BI \-w " seconds"
+Window in seconds to look back for new files while indexing. This option will limit indexing to only files newer than N seconds ago. This can help speed up indexing. Typical recommened default is 86400 (1 Day).
+.TP
+.BR \-h " print this message"
+.SH SEE ALSO
+.MR ssync 1
+.MR ssync 5
+.MR ssync-queue 1
+.MR ssync-fetch 1
+.SH REPOSITORY
+.UR https://git.senders.io/utils/ssync.git
+.UE
+.SH AUTHORS
+Steph Enders
+.MT steph@senders.io
+.ME
+ssync-index is open source licensed under the ISC license. See LICENSE.txt for full copyright information.
diff --git a/docs/ssync-queue.1 b/docs/ssync-queue.1
new file mode 100644
index 0000000..1af4275
--- /dev/null
+++ b/docs/ssync-queue.1
@@ -0,0 +1,39 @@
+.TH ssync-queue 1 "December 2025" "2.0.0"
+.SH NAME
+ssync-queue \- generate ssync queue from local and remote indicies
+.SH SYNOPSIS
+.B ssync-queue
+[option...]
+.BI \-l " local_index"
+.BI \-r " remote_index"
+.BI \-o " queue_output"
+.YS
+.SH OPTIONS
+.TP
+.BI \-l " file"
+Local index file generated by
+.MR ssync-index 1
+.TP
+.BI \-r " file"
+Remote index file generated by
+.MR ssync-index 1
+.TP
+.BI \-o " file"
+Queue output file.
+.TP
+.BR \-v " verbose logging"
+.TP
+.BR \-h " print this message"
+.SH SEE ALSO
+.MR ssync 1
+.MR ssync 5
+.MR ssync-index 1
+.MR ssync-fetch 1
+.SH REPOSITORY
+.UR https://git.senders.io/utils/ssync.git
+.UE
+.SH AUTHORS
+Steph Enders
+.MT steph@senders.io
+.ME
+ssync-queue is open source licensed under the ISC license. See LICENSE.txt for full copyright information.
diff --git a/docs/ssync.1 b/docs/ssync.1
index c6571c8..ab3d82d 100644
--- a/docs/ssync.1
+++ b/docs/ssync.1
@@ -1,14 +1,11 @@
.TH ssync 1 "December 2025" "2.0.0"
.SH NAME
-ssync
+ssync \- simple suite of syncing scripts
.SH SYNOPSIS
.B ssync
-.RB [OPTION]...
+[option...]
.IR CONFIG_FILE
.YS
-.SH DESCRIPTION
-.B ssync
-\- simple suite of syncing scripts
.SH OPTIONS
.TP
.BI \-b " backend"
diff --git a/ssync b/ssync
index b61528c..2839354 100755
--- a/ssync
+++ b/ssync
@@ -4,7 +4,6 @@ set -e
USAGE="ssync [options] CONFIG_FILE
OPTIONS
-b BACKEND
- -n no locking
-v verbose logging
-h print this message"
diff --git a/ssync-queue b/ssync-queue
index 35e430b..9aacf0a 100755
--- a/ssync-queue
+++ b/ssync-queue
@@ -1,6 +1,6 @@
#!/usr/bin/env sh
-USAGE="ssync-queue [options] -l LOCAL_INDEX_FILE -r REMOTE_INDEX_FILE -q QUEUE_OUTPUT_FILE
+USAGE="ssync-queue [options] -l LOCAL_INDEX_FILE -r REMOTE_INDEX_FILE -o QUEUE_OUTPUT_FILE
OPTIONS
-l LOCAL_INDEX_FILE
target local index file