#!/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 " 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"