pull-plex, fix rm command, change the catted file to be the dirname, and add better output.

This commit is contained in:
me
2026-08-25 14:44:43 -07:00
parent 500db502cc
commit 10b33b023c
+8 -6
View File
@@ -390,22 +390,24 @@ function pull-plex {
dest=/sdcard/Movies/ dest=/sdcard/Movies/
fi fi
echo "`date` - Copying files from '$plex_dir' to '$dest'."
su -c "cp -Rv '$plex_dir'/{1,2}/* '$dest'" su -c "cp -Rv '$plex_dir'/{1,2}/* '$dest'"
echo -e "\n`date` - Combining videos split into chunks."
cd "$dest" cd "$dest"
ls | while read dir; do ls | while read dir; do
echo "Checking '$dir'" echo -e "\n Checking '$dir'"
cd "$dir" cd "$dir"
ls -lh ls -lh
# Unsure why -e and -f don't work here. Spaces in filenames? Globs? # Unsure why -e and -f don't work here. Spaces in filenames? Globs?
if [[ `ls *.chunk0 2>/dev/null` ]]; then if [[ `ls *.chunk0 2>/dev/null` ]]; then
final="movie.mkv" final="$dir.mkv"
echo "Catting files together to make '$final'." echo -e "\n Catting files together to make '$final'."
cat *.chunk* > $final cat *.chunk* > "$final"
ls -lh $final ls -lh "$final"
rm -v *.chunk* mv -v *.chunk* ~/TRASH/
fi fi
cd .. cd ..
done done