blob: 37e06e157592fcdd4df25dea39fa180c0c4490e9 (
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
|
#!/bin/bash
#
# A mini-wrapper to sync a local folder into kobo.
#
# 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
# Dispatch
lftp -c "open sftp://kobo && mirror -X *.sdr --delete -L -R $BASEFOLDER/$COLLECTION /mnt/sd/$COLLECTION"
|