dataindex: stripped redundant parent folders

master
Pierre Neidhardt 2013-10-16 14:22:01 +02:00
parent 7bc502f914
commit c9521eb0a6
4 changed files with 11 additions and 21 deletions

View File

@ -32,6 +32,7 @@ prependpath()
appendpath "${HOME}/.launchers/"
appendpath "${HOME}/.scripts/"
appendpath "${HOME}/.hackpool/"
## TeXlive
TEXDIR="${TEXDIR:-/usr/local/texlive}"

View File

@ -5,7 +5,7 @@ DATE=
_printhelp ()
{
cat<<EOF
Usage: ${1##*/} [-f]
Usage: ${1##*/} [-f] FOLDERS
Create index of folder hierarchies. This is used as a small "backup" purpose. In
case of data loss, it is still possible to get the full file list thanks to the
@ -49,7 +49,7 @@ for i ; do
OUTPUT="${i##*/}.index"
[ -e "$OUTPUT" ] && $OPT_NOCLOBBER && OUTPUT="${i##*/}-$(date +%F-%T).index"
echo "$OUTPUT"
find "$i" -type f | sort > "$OUTPUT"
echo "## $(date +%F)" >> "$OUTPUT"
(cd "$i" && find * -type f) | sort > "$OUTPUT"
# echo "## $(date +%F)" >> "$OUTPUT"
done

View File

@ -1,18 +0,0 @@
#!/bin/sh
if [ $# -ne 1 ] && [ $# -ne 2 ]; then
echo "Usage: $0 ROOTDIR [MOUNTPOINT]"
exit
fi
if [ -w "$(command -v realpath)" ]; then
echo "You need 'realpath'."
exit
fi
if [ -w "$(command -v encfs)" ]; then
echo "You need 'encfs'."
exit
fi
MOUNTPOINT="$2"
[ $# -ne 2 ]; MOUNTPOINT="${1}_dc"
encfs "$(realpath "$1")" "$(realpath "$MOUNTPOINT")"

View File

@ -111,3 +111,10 @@ if [ -d "$SOURCEDIR" ]; then
ln -snf "$SOURCEDIR/launchers" "$HOME/.launchers"
echo
fi
## Temp scripts
if [ -d "$SOURCEDIR" ]; then
echo "==> Hackpool"
ln -snf "$SOURCEDIR/hackpool" "$HOME/.hackpool"
echo
fi