From 3c68dc3657fc7ea33fa743b666e8e7c8b2e056ae Mon Sep 17 00:00:00 2001 From: xeruf <27jf@pm.me> Date: Tue, 12 Oct 2021 09:17:45 +0200 Subject: [PATCH] bin: update file serving --- .local/bin/scripts/roam | 5 +---- .local/bin/scripts/scpr | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) create mode 100755 .local/bin/scripts/scpr diff --git a/.local/bin/scripts/roam b/.local/bin/scripts/roam index dd18c27..6798ca3 100755 --- a/.local/bin/scripts/roam +++ b/.local/bin/scripts/roam @@ -1,7 +1,4 @@ #!/bin/sh -e # Move roam files into subfolders cd $DATA/2-standards/notes/roam -grep -l --directories=skip "roam_tags: person" * | xargs --no-run-if-empty mv -t people -grep -l --directories=skip "roam_tags: tech" * | xargs --verbose --no-run-if-empty mv -t tech -grep -l --directories=skip "roam_tags: project" * | xargs --verbose --no-run-if-empty mv -t projects -grep -l --directories=skip "roam_tags: health" * | xargs --verbose --no-run-if-empty mv -t health +find . -mindepth 1 -type d -printf '%f\n' | while read dir; do grep -l --directories=skip "roam_tags: $dir" * | xargs --verbose --no-run-if-empty mv -t "$dir"; done diff --git a/.local/bin/scripts/scpr b/.local/bin/scripts/scpr new file mode 100755 index 0000000..e8e6272 --- /dev/null +++ b/.local/bin/scripts/scpr @@ -0,0 +1,6 @@ +#!/bin/sh +# Copy recursively over ssh +server="$1" +folder="$2" +ssh "$server" "mkdir -p '$folder'" +scp -rC "${@:2}" "$server:$folder"