2018-02-18 20:57:47 +00:00
|
|
|
#!/bin/bash
|
2018-02-28 04:27:41 +00:00
|
|
|
|
2018-02-18 20:57:47 +00:00
|
|
|
# Usage: Zips given directories into .cbz (Comic Book ZIP) archives of the smame name (eg "folder name.cbz").
|
|
|
|
|
2018-03-02 20:06:21 +00:00
|
|
|
# This is synced against Mi Manga Nu android app
|
|
|
|
# using resilio sync
|
2018-02-18 20:57:47 +00:00
|
|
|
COMIC_ROOT="/home/nemo/Downloads/Books/Comics"
|
2018-03-02 20:06:21 +00:00
|
|
|
COMIC_EXPORT_ROOT="/home/nemo/Downloads/Books/Comics-CBZ"
|
2018-02-18 20:57:47 +00:00
|
|
|
cd $COMIC_ROOT
|
|
|
|
|
|
|
|
while read comic_dir; do
|
2018-03-02 20:06:21 +00:00
|
|
|
if [[ -f "$comic_dir.cbz" ]]; then
|
|
|
|
echo "[Exists] $comic_dir.cbz"
|
|
|
|
else
|
|
|
|
echo "[DL] $comic_dir"
|
|
|
|
cbz.sh -k "$comic_dir" > /dev/null
|
|
|
|
fi
|
2018-02-28 04:27:41 +00:00
|
|
|
done < <(find . -mindepth 3 -maxdepth 3 -type d)
|
|
|
|
|
|
|
|
# Sync it as well
|
|
|
|
for dir in *; do
|
2018-03-02 20:06:21 +00:00
|
|
|
cd $dir
|
2018-08-02 02:52:06 +00:00
|
|
|
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
|
2018-03-02 20:06:21 +00:00
|
|
|
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 ..
|
2018-02-28 04:27:41 +00:00
|
|
|
done
|