]> ###2025.09.06 - python cross check - skip if already installed ###2025.02.18 - small emby / jelly return fix ###2025.02.17 - fixed typos to reduce spam ###2025.02.16 - added http / https Mediaserver lookup - sorting pushbits Notifications - hopefully finally sorted special Chars in folder / filenames ###2025.02.03 - may bug fix - jq errors ###2025.02.01 - small bug fix ###2025.01.27 - cache mover additional options besides regular cache - array setup - cache pool (ssd) outside the regular array (see support forum for mergerfs option to benefit) - multiply sources outside regular array (see support forum for mergerfs option to benefit) - multiply rewrite function for Mediaserver mounts added if there is a multi array setup - upper features requires some Fuse System, recommended mergerfs plugin to build a proper Share - sample mounts will follow in Forum to benefit from cache mover together with external pool or external disks, arrays - together with mergerfs Shares - - no more source disk setup necessary (in terms not all disks wanted, use existing exclusion function) - existing setups dont need any reconfiguration, only if new functions are wanted to be used - copy file only mode (not recommended, only as feature been wished) - removed move mode function, copy was and is recommended to not play ping pong with files, no more option therefore ###2025.01.21 - fixing brackets in mover cleaning list - cleaning fix for empty exclusion entries, all non existend will be removed on list update ###2025.01.11a - added rewrite option in terms docker mountpoints are not 1:1 (mnt - mnt) ###2025.01.11 - included a MediaServer Option - ability to use current played files from MediaServers directly instead open files from disk (or multi mode) - fixing jellyfin, emby open file issue in some conditions - Mediaserver setup following general rules, subfolders, fileytypes, wait time, exclusions ###2024.12.25 - included a exclusion Option - more aggressiv watching for write files to skip execution ###2024.12.23c - small update fix - added file write check and break processing ###2024.12.22 - fixed 6.12.13+ compatibility - updated gdb and python on v7 ###2024.12.20 - fixed move files perm in edge case ###2024.12.18 - fixed log fetching (less spam) ###2024.12.17e - added list page for cached dirs and current mover tuning exluded list ###2024.12.17d - fixes due changes - max chars for filepath fixed - initial beta release **Cache Mover** Plugin to move playing Media Files from array disks to a pool device in user Share while watching and keep them there by rules, incl. live switching in background. &gitURL;/packages/&name;.txz &gitURL;/packages/fdclose.txz &gitURL;/packages/gdb-15.2-x86_64-3.txz &gitURL;/packages/gdb-11.2-x86_64-1.txz &gitURL;/packages/guile-3.0.7-x86_64-1.txz &gitURL;/packages/gc-8.0.6-x86_64-1.txz &gitURL;/packages/elfutils-0.186-x86_64-1.txz echo "Checking executable flags..." if [ -f /usr/local/emhttp/plugins/cache-mover/scripts/none ]; then if [ ! -x /usr/local/emhttp/plugins/cache-mover/scripts/none ]; then chmod +x /usr/local/emhttp/plugins/cache-mover/scripts/* echo "scripts are executable." else echo "scripts where already executable." fi else echo "script doesn't exist." fi touch /usr/local/emhttp/plugins/cache-mover/cache_cleaner_log.txt touch /usr/local/emhttp/plugins/cache-mover/cache_mover_log.txt echo "+==============================================================================" echo "| Checking Unraid Version ..." unraid_version_break="7.0" unraid_version=$(cat /etc/unraid-version | cut -d '"' -f 2 | cut -d '.' -f 1,2) unraid_version_main=$(echo $unraid_version | cut -d '.' -f 1) unraid_version_sub=$(echo $unraid_version | cut -d '.' -f 2) unraid_version_break_main=$(echo $unraid_version_break | cut -d '.' -f 1) unraid_version_break_sub=$(echo $unraid_version_break | cut -d '.' -f 2) if [ $unraid_version_main -gt $unraid_version_break_main ]; then current_packages="1" else if [ $unraid_version_main -eq $unraid_version_break_main ]; then if [ $unraid_version_sub -lt $unraid_version_break_sub ]; then current_packages="0" else current_packages="1" fi else current_packages="0" fi fi if [ $current_packages -eq 0 ]; then python_package="python3-3.9.10-x86_64-1.txz" libffi_package="libffi-3.3-x86_64-3.txz" libuni_package="libunistring-0.9.10-x86_64-3.txz" echo "| installing extra pre $unraid_version_break packages" if [ -f "/boot/config/plugins/cache-mover/$python_package" ]; then echo "| $python_package already here and ready to install" else echo "| File does not exist, downloading now ..." curl -o /boot/config/plugins/cache-mover/$python_package https://raw.githubusercontent.com/alturismo/unraid-cache-mover/master/packages/$python_package fi if [ -f "/boot/config/plugins/cache-mover/$libffi_package" ]; then echo "| $libffi_package already here and ready to install" else echo "| File does not exist, downloading now ..." curl -o /boot/config/plugins/cache-mover/$libffi_package https://raw.githubusercontent.com/alturismo/unraid-cache-mover/master/packages/$libffi_package fi if [ -f "/boot/config/plugins/cache-mover/$libuni_package" ]; then echo "| $libuni_package already here and ready to install" else echo "| File does not exist, downloading now ..." curl -o /boot/config/plugins/cache-mover/$libuni_package https://raw.githubusercontent.com/alturismo/unraid-cache-mover/master/packages/$libuni_package fi if [ ! -e /boot/config/plugins/dwpython.plg ] && ! type python3 >/dev/null 2>&1 && ! compgen -G "/boot/extra/python*" >/dev/null 2>&1; then # install python only if not installed by other plugin or /boot/extra or already installed installpkg /boot/config/plugins/cache-mover/$python_package else echo "| python already existent" fi installpkg /boot/config/plugins/cache-mover/$libffi_package installpkg /boot/config/plugins/cache-mover/$libuni_package else python_package="python3-3.12.8-x86_64-1.txz" echo "| installing extra $unraid_version_break ++ packages" if [ -f "/boot/config/plugins/cache-mover/$python_package" ]; then echo "| $python_package already here and ready to install" else echo "| File does not exist, downloading now ..." curl -o /boot/config/plugins/cache-mover/$python_package https://raw.githubusercontent.com/alturismo/unraid-cache-mover/master/packages/$python_package fi if [ ! -e /boot/config/plugins/dwpython.plg ] && ! type python3 >/dev/null 2>&1 && ! compgen -G "/boot/extra/python*" >/dev/null 2>&1; then # install python only if not installed by other plugin or /boot/extra or already installed installpkg /boot/config/plugins/cache-mover/$python_package else echo "| python already existent" fi fi echo "+==============================================================================" echo "+==============================================================================" echo "| default configuration if not existend" def_settingsfile="/usr/local/emhttp/plugins/cache-mover/default_cachemoversettings" settingsfile="/boot/config/plugins/cache-mover/cachemoversettings" if test -f "$settingsfile"; then echo "| $FILE already there" else cp $def_settingsfile $settingsfile echo "| copy default $FILE" fi echo "+==============================================================================" echo "+==============================================================================" echo "| Starting Actions and Cache Mover if crons where set ..." touch /boot/config/plugins/cache-mover/cachemoversettings sed -i 's/^script_cron_state=.*//' /boot/config/plugins/cache-mover/cachemoversettings sed -i 's/^clean_cron_state=.*//' /boot/config/plugins/cache-mover/cachemoversettings sed -i '/^$/d' /boot/config/plugins/cache-mover/cachemoversettings echo 'script_cron_state=""' >> /boot/config/plugins/cache-mover/cachemoversettings echo 'clean_cron_state=""' >> /boot/config/plugins/cache-mover/cachemoversettings /usr/local/emhttp/plugins/cache-mover/scripts/cache_mover_cron.sh /usr/local/emhttp/plugins/cache-mover/scripts/cache_cleaner_cron.sh if [ ! -z "$(crontab -l | grep -i Cache_Mover)" ]; then echo "| cronjob for Cache Mover started" sed -i 's/^script_cron_state=.*/script_cron_state="started"/' /boot/config/plugins/cache-mover/cachemoversettings else echo "| cron for Cache Mover not started" sed -i 's/^script_cron_state=.*/script_cron_state="stopped"/' /boot/config/plugins/cache-mover/cachemoversettings fi if [ ! -z "$(crontab -l | grep -i Cache_Cleaner)" ]; then echo "| cronjob for Cache Cleaner started" sed -i 's/^clean_cron_state=.*/clean_cron_state="started"/' /boot/config/plugins/cache-mover/cachemoversettings else echo "| cron for Cache Cleaner not started" sed -i 's/^clean_cron_state=.*/clean_cron_state="stopped"/' /boot/config/plugins/cache-mover/cachemoversettings fi echo "+==============================================================================" rm -f $(ls &plgPATH;/&name;*.txz 2>/dev/null|grep -v '&version;') echo "Removing &name;..." echo "can take a while as python3 is ..." removepkg &plgPATH;/*.txz 1> /dev/null rm -rf &plgPATH; rm -rf &emhttp; sed -i 's/^script_cron_state=.*//' /boot/config/plugins/cache-mover/cachemoversettings sed -i 's/^clean_cron_state=.*//' /boot/config/plugins/cache-mover/cachemoversettings sed -i '/^$/d' /boot/config/plugins/cache-mover/cachemoversettings echo "&name; has been removed"