aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/.local/bin/bkup
diff options
context:
space:
mode:
authorYaroslav de la Peña Smirnov <yps@yaroslavps.com>2023-01-02 18:24:19 +0300
committerYaroslav de la Peña Smirnov <yps@yaroslavps.com>2023-01-02 18:24:19 +0300
commiteab3ad3a252656d57639ce94867b2a7c3f80bde2 (patch)
treea39613b3f5bc2bbc31725cd4e1f4bcb9e6fc250e /dotfiles/.local/bin/bkup
parent20e89413859412e5c2bd475f11b4d3c320213578 (diff)
downloadswayrice-eab3ad3a252656d57639ce94867b2a7c3f80bde2.tar.gz
swayrice-eab3ad3a252656d57639ce94867b2a7c3f80bde2.zip
cleanup no longer needed files
Diffstat (limited to 'dotfiles/.local/bin/bkup')
-rwxr-xr-xdotfiles/.local/bin/bkup52
1 files changed, 0 insertions, 52 deletions
diff --git a/dotfiles/.local/bin/bkup b/dotfiles/.local/bin/bkup
deleted file mode 100755
index 0e4d503..0000000
--- a/dotfiles/.local/bin/bkup
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/bin/sh
-
-# Yaroslav de la Peña Smirnov 2021
-# Shortcut script for backing up files with rsync.
-# By default it starts a dry run, to check that there are no conflicts. To
-# commit the copy, i.e. do a normal (non-dry) run, use -c as the first or last
-# argument.
-
-############################# Config example ###################################
-## Lines in the locations file contain the shortcuts for the sources and
-## destinations. For example, sources:
-# src d /home/yaroslav/docs
-# src m /home/yaroslav/music
-## destinations:
-# dst rm yaroslav@example.com:
-# dst hd /mnt/disk/
-## The columns MUST be separated by ONE tab character
-################################################################################
-
-locations="$HOME/docs/data/bkup/locations"
-ops="-ahv --delete --progress"
-
-if [ "$1" = "-c" ]; then
- srckey="$2"
- dstkey="$3"
-else
- if [ "$3" != "-c" ]; then
- ops="-ahvn --delete"
- fi
- srckey="$1"
- dstkey="$2"
-fi
-
-if [ -z $srckey ] || [ -z $dstkey ]; then
- echo "Usage: bkup [-c] <source shortcut> <destination shortcut> [-c]"
- exit 1
-fi
-
-relsrc="$(grep -E "src[[:space:]]+$srckey" "$locations" | cut -f3)"
-if [ -z "$relsrc" ]; then
- echo "Source shortcut not found"
- exit 1
-fi
-target="$(echo "$relsrc" | awk -F'/' '{print $(NF)}')"
-
-reldst="$(grep -E "dst[[:space:]]+$dstkey[[:space:]]+" "$locations" | cut -f3)"
-if [ -z "$reldst" ]; then
- echo "Destination shortcut not found"
- exit 1
-fi
-
-rsync $ops "$relsrc/" "$reldst$target/"