]> ###2024.09.05.0222 - Fix find not finding hidden files. Thanks solidno8 from forums. [R3yn4ld] 2024.09.05.0115 - Add compatibility with unraid 7.x for share_mover [R3yn4ld] - Fix "integer expression expected" thanks to [RonaldJerez] - Fix "0: command not found" bugs [R3yn4ld] ###2024.08.18 - Fix blank grep to rsync loop causing "Warning no action for; integer expected; unary operator expected" errors [R3yn4ld] ###2024.08.17 - Fix settings override not reverting [R3yn4ld] ###2024.08.15 - Fix ignore list reserved space double quoting (Thanks silver226) [R3yn4ld] - Better empty folder cleaner [R3yn4ld] - Rewritten to rmdir parent directory of a moved file if empty (drawbacks: will let multidirectory dirs alive) - Added option to enable/disable empty folder cleaner added in Settings UI - UI improvements, settings sorted - Even better cache priming (hopefully) [R3yn4ld] - Rewriten Ignore filelist from file and filetypes filtering functions (major) - Improve calculating size of filtered files and filetypes - Update calculation from basic/bc to numfmt. Removed bc option - Added verification for not breaking hardlinks when an hardlinked file is filtered - Added testmode to cleaning empty folder function, and a min depth of 2. - Fixed ctime bug ###2024.08.12 - Add bc (un)install option [R3yn4ld] - Force test mode only on major upgrade, keep on minor. [R3yn4ld] - Repair/optimize cache priming. - Adding check to bc (un)installation routine - Add bc (un)install option - Force test mode only on major upgrade, keep on minor. ###2024.08.11 - Allow-operation-without-array-if-multiple-pools [R3yn4ld]: Fixed fatal error bug - Fixed error message about mover.pid and softstop file when installing the plugin or booting Unraid [R3yn4ld] ###2024.08.10 - Better filtering with ctime=no [R3yn4ld] - Improved Synchronization [R3yn4ld]: - Improve synchronization by looking for files on cache first - Do not count synchronized files twice (freeing/priming target were half achieved) - Optimize Filtering File and Decision loops regarding Rebalance and Synchronize - Moved test mode on top of Mover Tuning Page [R3yn4ld] - Add check for primary storage not existing (dust config files) [R3yn4ld] ###2024.08.07 - Fix bug introduced by "Allow operation without array if multiple pools" preventing mover to run if less than 2 pools installed. - Allow operation without array if multiple pools [R3yn4ld]. Unraid 7.0.0.beta2 may be required for this to work (6.x gui might not allow to have pool as Primary and Secondary) - Add cleanup empty folder function[R3yn4ld] ###2024.08.06 - Bug fixes [R3yn4ld]: - Resynchronize not working for share below moving threshold. - Internal mover moving files from Secondary to Primary instead of syncing (you may Resynchronize to correct the effect) - Added Resynchronize all Primary files to Secondary option [R3yn4ld]: Resynchronize all Primary files to Secondary. This will resynchronize the Primary (cached) files on both Primary and Secondary (array) so they are backed up and parity protected. All files will be synchronized again independently of modification time. This can be a long operation. Run-once setting will reset back to No after next run - Minor bug fixes and improvements [R3yn4ld] ###2024.08.05 - Enhance previous "Repair Primary" option. Renamed it "Rebalance shares". This will move files from shares to their primary and secondary storage if spread elsewhere. May imply moving older files from Primary->Secondary or Secondary->Primary if allowed (cache:prefer or cache:yes) to free some space. [R3yn4ld] - Bug fixes [R3yn4ld] ###2024.08.04 - Unraid 7.0.0 beta2 Secondary storage Compatibility: minor enhancements (6.12 mover action naming) and... can now move between pools (tested on 7.0.0-beta2) ! - Fix find not ignoring hidden files [R3yn4ld] (Thanks to helpful-tune3401) - Fix default Settings handling causing a "Unrary operator" bug [R3yn4ld] (thanks to Alturismo) - Add freeing threshold option [R3yn4ld] ###2024.08.01 - Deleted share error control [R3yn4ld] - SoftStop improvement [R3yn4ld] ###2024.07.30 - Update to repair broken installation from previous bugs [R3yn4ld] - Enhance internal mover function [R3yn4ld] - Fixed "cache=yes" shares not moving above threshold [R3yn4ld] ###2024.07.29b - Various bug fixes [R3yn4ld], [Freender] ###2024.07.29 - Complete rewrite of file listing functions (find, decide to move..) [R3yn4ld] - Internal moving/syncing engine [R3yn4ld] - Fix an issue with inaccurate capacity when raid z1 is used. Updated zfs functions getting usage of a pool [Freender] - Added cache mode "prefer" smart moving in "Automatic age" mode [R3yn4ld] - Added option to "repair" Cache:Only (moving everything on share to cache) and Cache:No (moving everything on share to array) shares [R3yn4ld] - Added option to synchronize Cache:Yes and Cache:Prefer shares to array so data are parity protected [R3yn4ld] - Turbo write mode forcing improvement to not wake spinners if not needed [R3yn4ld] - UI improvements [R3yn4ld] ###2024.07.10 - Unraid 7.0.0 compatibility (/ 6.x bug?): original mover now works with "Move Now button follows plug-in filters" set to off [R3yn4ld] ###2024.07.07 - Unraid 7.0.0 compatibility [R3yn4ld] ###2024-06-30 - Automatic age threshold and plugin cleaning [R3yn4ld] - Minor spelling corrections and README [Dphelan] - Merge share skipfiletypes [Davendsai] (add/merge per share skipfilestype to global skips) - Update Mover.tuning.page [Squid] ###2023.12.19 - Change "while read" lines in age_mover to "while IFS= read -r" to fix trailing white spaces [Swarles] - Fix where sometimes mover would not run to mover.old scrip [Swarles] - Log if "share.cfg" doesn't exists to help trouble shooting [Swarles] - Check for ca.mover.tuning.cfg file and additional logging. [Swarles] ###2023.08.22 - Fixed Cron Job entry - Modified ignore command to include folders [Swarles] - Updated mover cmdline functions [Hugenbdd] ###2023.07.03 - Add check and creation of link to new binary move location. (Allows the plugin to survive a reboot) - Fix first time save on scheduler page. [Swarles/Yamraid 6/21] - Change "move all" default setting to No to not confuse new installs/users. [Swarles] - Custom mover tuning settings for individual shares. Located at “Shares>[click share]>Mover Tuning”. Includes age, size, sparseness, file list, file types, hidden files/directories, move all override. [Swarles 6/2023] ###2023.06.21 - Fix spaces in before script file path [Swarles 6-18-2023] - Fix spaces in after script file path [Swarles 6-18-2023] - Fix spaces in ignore file list path [Swarles 6-18-2023] - Add check before moving to make sure file or directory exists to avoid binary mover lstat error. [DontWorryScro 6-19-2023] ###2023.06.16 - Fix no empty directories file - Fix missing echo statement on hardlinks area. [Foux 6-16-2023] ###2023.06.15 - Delete empty directories - Add Softlink for binary mover file change if on 6.12 RC8 in install script. [CS01-HS Found 6/13] - Add function for compatibility with RC8+ with zfs % full [a632079 - 6/3] ###2023.05.23 - Fixed Hardlinks issue. - If hardlinks detected in fileslit. - No GUI update is available. - No Soft Stop available. ###2023.05.18 - Fixed a issue where SED was seeing [] and {} inside of the filepath string, by double quoting the echo'd variable. - Added softstop as a command to gracefully exit the mover from the command line. Checks for a file under /var/run/moversoft.stop. before sending each file to the binary mover. Will exit the loop if the file exists and mover will stop once the current file is done moving. Example: /usr/local/emhttp/plugins/ca.mover.tuning/age_mover softstop ###2023.05.16 - Changed to a file list instead of piping the output from the find command to the binary mover. (excludes share mover button) - Moved logs to /tmp/Mover/ - Supports GUI update to allow percent complete, and number of files complete. (customized files needed for this can be found in my github) - ArrayOperation.page, nchan/parity_list ### See previous releases for earlier notes... ]]> # Remove old 'source' files rm -f $(ls /boot/config/plugins/&name;/&name;*.txz 2>/dev/null | grep -v '&version;') https://github.com/&github;/raw/&branch;/archive/&name;-&version;-x86_64-1.txz &md5; echo "" if [[ -e /usr/local/sbin/mover ]]; then if [[ ! -f /usr/local/sbin/mover.old ]]; then echo "Backing up current /usr/local/sbin/mover binary" mv /usr/local/sbin/mover /usr/local/sbin/mover.old fi elif [[ -e /usr/local/bin/mover ]]; then if [[ ! -f /usr/local/bin/mover.old ]]; then echo "Backing up current /usr/local/bin/mover binary " mv /usr/local/bin/mover /usr/local/bin/mover.old fi fi echo "Installing tuned mover script" cp /usr/local/emhttp/plugins/&name;/mover /usr/local/sbin/mover # Cleaning eventual leftovers if ! pgrep age_mover; then echo "Cleaning lock and stop files" for file in mover.pid moversoft.stop; do if [[ -e "/var/run/$file" ]]; then rm -f "/var/run/$file"; fi done fi echo "Fixing permissions" chmod +x /usr/local/sbin/mover chmod +x /usr/local/emhttp/plugins/ca.mover.tuning/*.php chmod +x /usr/local/emhttp/plugins/ca.mover.tuning/age_mover chmod +x /usr/local/emhttp/plugins/ca.mover.tuning/mover chmod +x /usr/local/emhttp/plugins/ca.mover.tuning/share_mover # Config file config_file=/boot/config/plugins/&name;/&name;.cfg; if [[ $(cat $config_file | wc -l) -eq 1 ]]; then rm $config_file fi if [[ ! -f "$config_file" ]]; then echo "Creating file $config_file with default configuration." # Create the file with some default values echo 'testmode="yes"' > $config_file echo 'logging="yes"' >> $config_file echo 'movenow="yes"' >> $config_file echo "version=&version;" >> "$config_file" else echo "Updating config file" if [ &upgrade; = "major" ]; then echo "- Major upgrade, forcing test mode" if grep -q "testmode" "$config_file"; then sed -i "s/testmode=.*$/testmode=\"yes\"/" "$config_file" else echo 'testmode="yes"' >> "$config_file" fi else echo "- Minor upgrade, not forcing test mode" fi echo "- Updating version number" if grep -q "version" "$config_file"; then sed -i "s/version=.*$/version=&version;/" "$config_file" else echo "version=&version;" >> "$config_file" fi if grep -q "threshold=" $config_file; then echo "- Updating movingThreshold" sed "s/threshold=/movingThreshold=/" -i "$config_file" fi if grep -q 'freeingThreshold=""' "$config_file"; then echo "- Updating freeingThreshold" thresh=$(grep "movingThreshold=" $config_file | cut -d'=' -f 2 | tr -d '"' | tr -d '\r') sed "s/freeingThreshold=.*$/freeingThreshold=$thresh/" -i "$config_file" fi if ! grep -q 'freeingThreshold=' $config_file; then echo "- Updating freeingThreshold" grep 'movingThreshold=' "$config_file" | sed 's/movingThreshold/freeingThreshold/' >> "$config_file" fi fi echo "" echo "----------------------------------------------------" echo " &name; has been installed." echo " Copyright 2018, Andrew Zawadzki" echo " Version: &version;" echo "----------------------------------------------------" echo "" if [[ -e /usr/local/sbin/mover.old ]]; then mv -f /usr/local/sbin/mover.old /usr/local/sbin/mover; fi if [[ -e /usr/local/bin/mover.old ]]; then mv -f /usr/local/bin/mover.old /usr/local/bin/mover; fi removepkg &name;-&version;-x86_64-1 rm -rf &plugdir; rm -rf /boot/config/plugins/&name; /usr/local/sbin/update_cron