aboutsummaryrefslogtreecommitdiff
path: root/ssync-queue
diff options
context:
space:
mode:
authorSteph Enders <steph@senders.io>2025-12-14 00:29:18 -0500
committerSteph Enders <steph@senders.io>2025-12-14 00:29:18 -0500
commitf5943bb301886984802384fdfcccbb3d97f797b7 (patch)
tree7bc0c0265cbc4fd072d57a81fb34509f6b60259c /ssync-queue
parentb7d58f5ca6bced94c3e031c4f53f377605367039 (diff)
Update ssync-queue to remove bash specific substititions
Add missing config option in ssync.5 Release 2.1.1
Diffstat (limited to 'ssync-queue')
-rwxr-xr-xssync-queue9
1 files changed, 6 insertions, 3 deletions
diff --git a/ssync-queue b/ssync-queue
index 021c1c3..2063420 100755
--- a/ssync-queue
+++ b/ssync-queue
@@ -83,7 +83,7 @@ remote_index_filenames_file=$queue_tmp_dir/remote_filenames.idx
verbose_log "Writing remote index filenames to $remote_index_filenames_file"
cat $REMOTE_FILE_ARG | xargs -I{} basename {} > $remote_index_filenames_file
original_line_count=$(lines $REMOTE_FILE_ARG)
-unique_line_count=$(lines <(sort -u $remote_index_filenames_file))
+unique_line_count=$(sort -u $remote_index_filenames_file | lines)
verbose_log "Remote index contains $unique_line_count unique filenames out of $original_line_count indexed files"
if [ $original_line_count != $unique_line_count ]; then
@@ -91,9 +91,12 @@ if [ $original_line_count != $unique_line_count ]; then
fi
# find which filenames are unique to the remote
+local_sorted=$queue_tmp_dir/local_sorted.idx
+remote_sorted=$queue_tmp_dir/remote_sorted.idx
remote_only_filenames_file=$queue_tmp_dir/remote_only_filenames.idx
-comm -23 <(sort $remote_index_filenames_file) <(sort $LOCAL_FILE_ARG) \
- > $remote_only_filenames_file
+sort $LOCAL_FILE_ARG > $local_sorted
+sort $remote_index_filenames_file > $remote_sorted
+comm -23 $remote_sorted $local_sorted > $remote_only_filenames_file
verbose_log "Found $(lines $remote_only_filenames_file) remote only files"
# push matching files into queue