mirror of https://github.com/captn3m0/Scripts.git
resilio doesn't sync symlinks, so copy and sync
This commit is contained in:
parent
8501ab5067
commit
f71c6adb99
|
@ -2,22 +2,32 @@
|
||||||
|
|
||||||
# Usage: Zips given directories into .cbz (Comic Book ZIP) archives of the smame name (eg "folder name.cbz").
|
# 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_ROOT="/home/nemo/Downloads/Books/Comics"
|
||||||
|
COMIC_EXPORT_ROOT="/home/nemo/Downloads/Books/Comics-CBZ"
|
||||||
cd $COMIC_ROOT
|
cd $COMIC_ROOT
|
||||||
|
|
||||||
while read comic_dir; do
|
while read comic_dir; do
|
||||||
if [[ -f "$comic_dir.cbz" ]]; then
|
if [[ -f "$comic_dir.cbz" ]]; then
|
||||||
echo "[Exists] $comic_dir.cbz"
|
echo "[Exists] $comic_dir.cbz"
|
||||||
else
|
else
|
||||||
echo "[DL] $comic_dir"
|
echo "[DL] $comic_dir"
|
||||||
cbz.sh -k "$comic_dir" > /dev/null
|
cbz.sh -k "$comic_dir" > /dev/null
|
||||||
fi
|
fi
|
||||||
done < <(find . -mindepth 3 -maxdepth 3 -type d)
|
done < <(find . -mindepth 3 -maxdepth 3 -type d)
|
||||||
|
|
||||||
# Sync it as well
|
# Sync it as well
|
||||||
for dir in *; do
|
for dir in *; do
|
||||||
cd $dir
|
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
|
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 ..
|
||||||
|
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
|
done
|
||||||
|
|
Loading…
Reference in New Issue