diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2020-05-10 14:05:28 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2020-05-10 14:05:28 -0300 |
commit | 5af14132212c62887b6159d2ff56526e5a8e70d5 (patch) | |
tree | dcbc2ba39dcf6f84e90525984ab394a54dde08f9 /sync-to-kobo | |
parent | 6e2774f19b6fb5c690fca94b976a16e962502fe8 (diff) | |
download | scripts-5af14132212c62887b6159d2ff56526e5a8e70d5.tar.gz scripts-5af14132212c62887b6159d2ff56526e5a8e70d5.tar.bz2 |
Rename receive/send from/to kobo as sync-from-kobo and sync-to-kobo
Diffstat (limited to 'sync-to-kobo')
-rwxr-xr-x | sync-to-kobo | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sync-to-kobo b/sync-to-kobo new file mode 100755 index 0000000..9384f3a --- /dev/null +++ b/sync-to-kobo @@ -0,0 +1,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 -L -R $BASEFOLDER/$COLLECTION /mnt/sd/$COLLECTION" |