blob: 74b89ef7b4d071877492bc52a84227b026c47d45 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#!/bin/bash
#
# A mini-wrapper to sync a kobo folder into a local one.
#
# Parameters
BASENAME="`basename $0`"
BASEFOLDER="$HOME/data/doc"
COLLECTION="$1"
# Check
if [ -z "$COLLECTION" ]; then
echo "usage: $BASENAME <colletion>"
echo "available collections:"
echo ""
ls $BASEFOLDER
exit 1
fi
# Ensure collection exists
if [ ! -d "$BASEFOLDER/$COLLECTION" ]; then
echo "error: no such collection $COLLECTION at $BASEFOLDER"
exit 1
fi
# Setup origin
if [ "$COLLECTION" == "clipboard" ]; then
ORIGIN="/mnt/onboard/.adds/koreader/clipboard"
else
ORIGIN="/mnt/sd/$COLLECTION"
fi
# Dispatch
lftp -c "open sftp://kobo && mirror -L $ORIGIN $BASEFOLDER/$COLLECTION"
|