From f71c6adb9953184c9b7c8ae391535ccc936b2352 Mon Sep 17 00:00:00 2001 From: Nemo Date: Sat, 3 Mar 2018 01:36:21 +0530 Subject: [PATCH] resilio doesn't sync symlinks, so copy and sync --- cbz-convertor.sh | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/cbz-convertor.sh b/cbz-convertor.sh index 9949e1a..aa5b8d4 100755 --- a/cbz-convertor.sh +++ b/cbz-convertor.sh @@ -2,22 +2,32 @@ # Usage: Zips given directories into .cbz (Comic Book ZIP) archives of the smame name (eg "folder name.cbz"). +# This is synced against Mi Manga Nu android app +# using resilio sync COMIC_ROOT="/home/nemo/Downloads/Books/Comics" - +COMIC_EXPORT_ROOT="/home/nemo/Downloads/Books/Comics-CBZ" cd $COMIC_ROOT while read comic_dir; do - if [[ -f "$comic_dir.cbz" ]]; then - echo "[Exists] $comic_dir.cbz" - else - echo "[DL] $comic_dir" - cbz.sh -k "$comic_dir" > /dev/null - fi + if [[ -f "$comic_dir.cbz" ]]; then + echo "[Exists] $comic_dir.cbz" + else + echo "[DL] $comic_dir" + cbz.sh -k "$comic_dir" > /dev/null + fi done < <(find . -mindepth 3 -maxdepth 3 -type d) # Sync it as well for dir in *; do - cd $dir - rsync --archive --include '*.cbz' --recursive * nemo@192.168.1.111:/mnt/xwing/media/EBooks/Comics/ --verbose --exclude '*.jpg' --exclude '*.png' --exclude '.sync' --prune-empty-dirs - cd .. + cd $dir + rsync --archive --include '*.cbz' --recursive * nemo@192.168.1.111:/mnt/xwing/media/EBooks/Comics/ --verbose --exclude '*.jpg' --exclude '*.png' --exclude '.sync' --prune-empty-dirs + cd .. +done + +# Sync them to the local export directory + +for dir in *; do + cd $dir + rsync --archive --include '*.cbz' --recursive * /home/nemo/Downloads/Books/Comics-CBZ/ --exclude '*.jpg' --exclude '*.png' --exclude '.sync' --prune-empty-dirs + cd .. done