bin: some more utilities
This commit is contained in:
parent
3fc358fd1d
commit
1cdb307e2a
|
@ -1,6 +1,9 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
# Simple backup with borg
|
# Simple backup with borg
|
||||||
test $# -eq 0 && borg list --format "{barchive:40} {time}{NL}" && exit 0
|
if test $# -eq 0
|
||||||
|
then borg list --format "{barchive:40} Created {time}{NL}"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
test "$1" = "-n" && run=arg-test && shift
|
test "$1" = "-n" && run=arg-test && shift
|
||||||
case "$1" in (*_) prefix=$1; shift;; esac
|
case "$1" in (*_) prefix=$1; shift;; esac
|
||||||
name="$(echo "$1" |
|
name="$(echo "$1" |
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
# Diff the result of the given commands
|
||||||
|
prefix=/tmp/difc-
|
||||||
|
highlight "Executing $1"
|
||||||
|
eval "$1" | sort >${prefix}1
|
||||||
|
highlight "Executing $2"
|
||||||
|
eval "$2" | sort >${prefix}2
|
||||||
|
dif "${prefix}1" "${prefix}2"
|
|
@ -1,3 +1,5 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh -e
|
||||||
# Displays the latest files in the given directory or pwd
|
# Displays the latest files in the given directory or pwd
|
||||||
find "${1:-$PWD}" -maxdepth 4 -type f -printf '%.16T+ %P\n' | sort -r | head
|
test "$1" = "-a" && all=true && shift
|
||||||
|
find "${1:-$PWD}" -maxdepth 4 -type f -printf '%.16T+ %P\n' |
|
||||||
|
sort -r | $(test "$all" && echo "less" || echo "head")
|
||||||
|
|
Loading…
Reference in New Issue