Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plugin] Mover Tuning

Featured Replies

5 minutes ago, Masterwishx said:

IIRC renaming cache pool from cache or/and share named data can solve the issue

Interesting.. if i feeling like moving the cache data back to the array and redoing both cache pools again i will name them what the shares are.. I added _cache to the names this time...

  • Replies 3.5k
  • Views 485.8k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • hugenbdd
    hugenbdd

    New Version 07-03-2023   HUGE thanks/Shout-out to @Swarles for the help with updating code fixes and adding a great new feature.  You can now have some customization per share.  It's great t

  • How to ignore a SINGLE file 1.) Find the path of the file you wish to ignore.     ls -ltr /mnt/cache/Download/complete/test.txt         root@Tower:/# ls -ltr /mnt/cache/Download/complete/test

  • Hi all, I made a new version of the plugin. This fork replaces @hugenbdd's plugin which is not maintained anymore and will land in community applications if your feedbacks are positive.  

Posted Images

5 minutes ago, Masterwishx said:

I see by logs its fine now ...

i made a new share and named it "zDoNotRemovez" and told it to use cache only and the appdata_cache pool so i might just leave it like this.. i never look at my share names so...

4 minutes ago, Marcvz said:

mover debug didnt create a zip file.

The file should be in /boot/logs/

11 hours ago, Marcvz said:

mover debug didnt create a zip file.
But the link in the help section did.

Mover_tuning_2025-06-11T215740.log :

21:57:40.577 After script: /tmp/user.scripts/tmpScripts/mover_afterRun/script
21:57:40.579 Before script: /tmp/user.scripts/tmpScripts/mover_beforeRun/script
...
21:57:40.603 Launching before script: /tmp/user.scripts/tmpScripts/mover_beforeRun/script
21:57:40.615 Before script finished
...
...
21:57:40.940 Action started at: 21:57:40
21:57:40.956 Launching after script: /tmp/user.scripts/tmpScripts/mover_afterRun/script
21:57:40.969 After script finished with result: 1

2 hours ago, Masterwishx said:

Mover_tuning_2025-06-11T215740.log :

21:57:40.577 After script: /tmp/user.scripts/tmpScripts/mover_afterRun/script
21:57:40.579 Before script: /tmp/user.scripts/tmpScripts/mover_beforeRun/script
...
21:57:40.603 Launching before script: /tmp/user.scripts/tmpScripts/mover_beforeRun/script
21:57:40.615 Before script finished
...
...
21:57:40.940 Action started at: 21:57:40
21:57:40.956 Launching after script: /tmp/user.scripts/tmpScripts/mover_afterRun/script
21:57:40.969 After script finished with result: 1

I'm not sure what you're trying to say?

3 minutes ago, Marcvz said:

I'm not sure what you're trying to say?

by the Log the befor/after script was runned

2 minutes ago, Masterwishx said:

by the Log the befor/after script was runned

That might be true. But mover did nothing inbetween..

That being said. I see the before and after scripts have an issue. Due to a deluge update it seems.
Maybe that causes the mover to fail..

When I install the plugin and dont change the settings it seems to work.
I'll try to pinpoint what setting causes it to not work anymore.

1 hour ago, Masterwishx said:

by the Log the befor/after script was runned

I've reinstalled the plugin and tried it without the before and awfter script.

But it doesn't work.

I've downloaded the 25-04-24 version and everything works fine again. Even with the before and after scripts.

So I'll just ignore the update warning for now.

This is a zip downloaded from the latest version without the before and after scripts

ca.mover.tuning-debug-20250612-1352.zip

Edited by Marcvz

8 hours ago, Marcvz said:

That might be true. But mover did nothing inbetween..

Just for info iirc in your log the mover threshold was not meet so nothing can be moved until then

6 hours ago, Marcvz said:

This is a zip downloaded from the latest version without the before and after scripts

No plugin logs and debug logs here ,seems plugin was not runned ?

3 hours ago, Masterwishx said:

Just for info iirc in your log the mover threshold was not meet so nothing can be moved until then

Normally it would tell me there is nothing to move because the threshold is not met.
It doesnt even get that far. It crashes before that.

Like I said, I've installed an older version and everything works perfectly again. So something broke in one of the changes since may.

6 hours ago, Marcvz said:

So something broke in one of the changes since may.

No other users was complaining for it, but good to know what /how it's broken in your case...

3 hours ago, Masterwishx said:

Just for info iirc in your log the mover threshold was not meet so nothing can be moved until then

Normally it would tell me there is nothing to move because the threshold is not met.
It doesnt even get that far. It crashes before that.

Like I said, I've installed an older version and everything works perfectly again. So something broke in one of the changes since may.

5 hours ago, Masterwishx said:

No other users was complaining for it, but good to know what /how it's broken in your case...

Well, that's kinda bold to draw a conclusion form that.
I think the group that uses the plugin has updated it, and saw there is a problem because their chache disk ran full, aint that big.

And the group becomes even more smaller if the problem is only there when you use a certain setting.

Of course I appreciate your work on the plugin and if my tone is a bit to harsh, I'm sorry for that.

I just don't know how can pinpoint it any further. The last zip I've posted is gathered from clicking the button in the plugin help section.
If there is not any sign of the plugin in there, I don't know why not.

And the plugin says it had made log files at the boot/logs location. But it didn't.

I'm now using the 2025-04-24a version. And that works perfectly.

The new version gives very little output. I've posted this a couple times.

Nothing else is there. No errors, no logs, no notification. Despite all these settings being on.

The old version gives me a notification every hour if it had moves something or not. How many files it moves etc etc.

The before and after scripts work. Everything is just perfect and the plugin does exactly what I need. So I'm really thankful for that because it enables me to fill some needs.

So it's no biggy to keep using the older version. Only thing bothering me is the update msg really.. ^^
I'll try again when there is a new version released. Maybe it'll be solved then.

If there are any specifics you want me to try for you. Let me know. I can even screen record if you want.

@Marcvz have you tried setting Move files tool to rsync?
Move doesn't seem to work for me either, cache was filling up, moved back to rsync and it's working again.
Haven't had time to debug yet.

1 hour ago, BZwart said:

@Marcvz have you tried setting Move files tool to rsync?
Move doesn't seem to work for me either, cache was filling up, moved back to rsync and it's working again.
Haven't had time to debug yet.

Yeah, I tried both options.

The plugin doesn't even get to the point where it looks what needs to be moved or not.

1 hour ago, Marcvz said:

Yeah, I tried both options.

The plugin doesn't even get to the point where it looks what needs to be moved or not.

There is definitely something wrong with your setup. This is your log file:

Jun 12 13:48:07 Tower plugin-manager: running: 'anonymous'
Jun 12 13:48:08 Tower plugin-manager: ca.mover.tuning.plg installed
Jun 12 13:48:24 Tower emhttpd: shcmd (28627): /usr/local/sbin/update_cron
Jun 12 13:50:00 Tower move: Unraid mover schedule enabled successfully.
Jun 12 13:50:00 Tower move: Error: Mover cron file does not exist
Jun 12 13:50:19 Tower emhttpd: shcmd (28740): /usr/local/sbin/mover start |& logger -t move &
Jun 12 13:50:19 Tower move: Starting Mover ...
Jun 12 13:50:19 Tower move: ionice -c 2 -n 0 nice -n 0 /usr/local/emhttp/plugins/ca.mover.tuning/age_mover 
Jun 12 13:50:19 Tower move: Mover Tuning Plugin version 2025.06.07
Jun 12 13:50:19 Tower move: 
Jun 12 13:50:19 Tower move: Usage: /usr/local/emhttp/plugins/ca.mover.tuning/age_mover <or> mover start [-e <disk_name>]
Jun 12 13:50:19 Tower move:        /usr/local/emhttp/plugins/ca.mover.tuning/age_mover <or> mover stop|softstop|status|reset|debug
Jun 12 13:50:19 Tower move:        <disk_name> must match pattern 'disk[0-9]*' and /mnt/<disk_name> must be a mountpoint
Jun 12 13:50:19 Tower move: 
Jun 12 13:50:19 Tower move: reset  - reset config file to default values and delete override config folder
Jun 12 13:50:19 Tower move: debug  - creating plugin diagnostics file at /boot/logs/ca.mover.tuning-debug-<date-time>.zip

And this is my log file:

Jun 12 09:59:26 Dammerung move: Starting Mover ...
Jun 12 09:59:26 Dammerung move: ionice -c 2 -n 0 nice -n 0 /usr/local/emhttp/plugins/ca.mover.tuning/age_mover start
Jun 12 09:59:26 Dammerung move: ***************************************************** Mover Tuning Plugin version 2025.06.01 ****************************************************
Jun 12 09:59:26 Dammerung move: Log Level: 1
Jun 12 09:59:26 Dammerung move: ----------------------------------------------------------------- Global settings ---------------------------------------------------------------
Jun 12 09:59:26 Dammerung move: Using global (cache:yes) moving threshold: 75 %
Jun 12 09:59:26 Dammerung move: Using global (cache:yes) freeing threshold: 60 %
Jun 12 09:59:26 Dammerung move: Using global (cache:prefer) fillup threshold: 95 %

You can see, you're not even making it to the age_mover script which is the main script of the plugin. And that's because age_mover is not being called with any arguments at all. Since it's so early into the script, we can even debug this through code inspection.

This is the very first few lines of mover.php and the only logs that you're actually seeing:

if ($cron && $cfg['moverDisabled'] == 'yes') {
    logger("Mover schedule disabled");
    exit();
}

if ($cfg['parity'] == 'no' && $vars['mdResyncPos']) {
    logger("Parity Check / rebuild in progress.  Not running mover");
    exit();
}

logger("Starting Mover ...");

startMover($args);

Your log entry is consistent up to this point and is the last log that indicates good working order:

Jun 12 13:50:19 Tower move: Starting Mover ...

So digging into startMover:

function startMover(array $args)
{
    global $vars, $cfg, $cron, $bash, $argv, $args;

    if ($argv[2]) {
        $args[] = trim($argv[2]);
    }

    if ($cfg['debuglogging'] == 'yes') {
        // If run manually by bash cli
        if ($bash) {
            logger("Manually executed (bash)\n");
        }
        // If run via crond then log it as cron
        else if ($cron) {
            logger("Auto executed (crond)\n");
        }
        // If run manually by button, $argv[1] is not set (""), then log it as move button
        else if (empty($argv[1])) {
            logger("Manually executed (Move button)\n");
        }
    }

    if (!$cron) {
        // Example usage of specific arguments
        if (isset($args[0])) {
            $option1 = $args[0];
            if ($cfg['debuglogging'] == 'yes') {
                logger("Option 1: $option1\n");
            }
        } else if (version_compare($vars['version'], '7.0.0', '<')) {
            $args[0] = 'start';
            $option1 = $args[0];
            if ($cfg['debuglogging'] == 'yes') {
                logger("Option 1 set to 'start' due to version < 7.0.0\n");
            }
        }

        // Combine all arguments into a single string with spaces
        $options = implode(' ', $args);

        // Example usage of $options
        if ($cfg['debuglogging'] == 'yes') {
            logger("Options: $options\n");
        }
    } else {
        $options = "start";
        logger("Cron + options: $options");
    }

    if ($options != "stop") {
        clearstatcache();
        $pid = @file_get_contents("/var/run/mover.pid");
        if ($pid) {
            logger("Mover already running");
            exit();
        }
    }
    if ($cfg['force'] == "yes") {
        $options = "";
        if ($cfg['forceParity'] == "no" && $vars['mdResyncPos']) {
            logger("Parity Check / Rebuild in Progress.  Not running forced move");
            exit();
        }
    }

    // Check if Move Now button follows plug-in filters
    if ($cfg['movenow'] == "yes") {
        $mover_str = "/usr/local/emhttp/plugins/ca.mover.tuning/age_mover";
    } else {
        $mover_str = "/usr/local/sbin/mover.old";
    }

    if ($options == "stop") {
        $niceLevel = $cfg['moverNice'] ?: "0";
        $ioLevel = $cfg['moverIO'] ?: "-c 2 -n 0";
        logger("ionice $ioLevel nice -n $niceLevel $mover_str stop");
        passthru("ionice $ioLevel nice -n $niceLevel $mover_str stop");
        exit();
    }

    if ($cron or $cfg['movenow'] == "yes") {
        //exec("echo 'running from cron or move now question is yes' >> /var/log/syslog");
        $niceLevel = $cfg['moverNice'] ?: "0";
        $ioLevel = $cfg['moverIO'] ?: "-c 2 -n 0";

        if ($cfg['movingThreshold'] >= 0 or $cfg['fillupThreshold'] >= 0 or $cfg['age'] == "yes" or $cfg['sizef'] == "yes" or $cfg['sparsnessf'] == "yes" or $cfg['filelistf'] == "yes" or $cfg['filetypesf'] == "yes" or $cfg['beforescript'] != '' or $cfg['afterscript'] != '' or $cfg['testmode'] == "yes") {
            $age_mover_str = "/usr/local/emhttp/plugins/ca.mover.tuning/age_mover";
            //exec("echo 'about to hit mover string here: $age_mover_str' >> /var/log/syslog");
            logger("ionice $ioLevel nice -n $niceLevel $age_mover_str $options");
            passthru("ionice $ioLevel nice -n $niceLevel $age_mover_str $options");
        }
    } else {
        //exec("echo 'Running from button' >> /var/log/syslog");
        //Default "move now" button has been hit.
        $niceLevel = $cfg['moverNice'] ?: "0";
        $ioLevel = $cfg['moverIO'] ?: "-c 2 -n 0";
        logger("ionice $ioLevel nice -n $niceLevel /usr/local/sbin/mover.old $options");
        passthru("ionice $ioLevel nice -n $niceLevel /usr/local/sbin/mover.old $options");
    }
}

The important part is your log entry:

Jun 12 13:50:19 Tower move: ionice -c 2 -n 0 nice -n 0 /usr/local/emhttp/plugins/ca.mover.tuning/age_mover 

and this line of code:

logger("ionice $ioLevel nice -n $niceLevel $age_mover_str $options");

This implies that $options is empty and the only way for options to be empty is for:

    if (!$cron) {
        // Example usage of specific arguments
        if (isset($args[0])) {
            $option1 = $args[0];
            if ($cfg['debuglogging'] == 'yes') {
                logger("Option 1: $option1\n");
            }
        } else if (version_compare($vars['version'], '7.0.0', '<')) {
            $args[0] = 'start';
            $option1 = $args[0];
            if ($cfg['debuglogging'] == 'yes') {
                logger("Option 1 set to 'start' due to version < 7.0.0\n");
            }
        }

        // Combine all arguments into a single string with spaces
        $options = implode(' ', $args);

        // Example usage of $options
        if ($cfg['debuglogging'] == 'yes') {
            logger("Options: $options\n");
        }
    } else {
        $options = "start";
        logger("Cron + options: $options");
    }
  • cron must evaluate false

  • args[0] is not set

  • plugin version is > 7.0.0 (it is)

So given that your issues seem to revolve around cron. What is it? Well at the top of the PHP file, it is defined as:

#!/usr/bin/php
<?PHP
require_once("/usr/local/emhttp/plugins/dynamix/include/Wrappers.php");

$cfg = parse_plugin_cfg("ca.mover.tuning");
$vars = @parse_ini_file("/var/local/emhttp/var.ini");
$cron = $argv[1] == "crond";
$bash = $argv[1] == "bash";
$args = [];

And crond is a basic linux daemon.

The only reason this worked before was because your plugin version was less than 7.0.0 and forced option to "start". I am not sure why this check exists, but given that your install doesn't have crond, that seems to be the bigger issue. You can test in a terminal:

root@Dammerung:~# crond --help
dillon's cron daemon 4.5
crond [-s dir] [-c dir] [-t dir] [-m user@host] [-M mailer] [-S|-L [file]] [-l level] [-b|-f|-d]
-s            directory of system crontabs (defaults to /etc/cron.d)
-c            directory of per-user crontabs (defaults to /var/spool/cron/crontabs)
-t            directory of timestamps (defaults to /var/spool/cron/cronstamps)
-m user@host  where should cron output be directed? (defaults to local user)
-M mailer     (defaults to /usr/sbin/sendmail)
-S            log to syslog using identity 'crond' (default)
-L file       log to specified file instead of syslog
-l loglevel   log events <= this level (defaults to notice (level 5))
-b            run in background (default)
-f            run in foreground
-d            run in debugging mode

Actually, looking into it it further, seems like cron itself is pulled from here:

// Check if value was changed
if ($cfg_moverDisabled != $_POST["ismoverDisabled"]) {
	// If mover schedule is disabled then rename 'mover.cron' to 'mover.cron.disabled'
	if ($_POST['ismoverDisabled'] == "yes") {
		// Check if the file exists before attempting to rename it
		if (file_exists("/boot/config/plugins/dynamix/mover.cron")) {
			if (!rename("/boot/config/plugins/dynamix/mover.cron", "/boot/config/plugins/dynamix/mover.cron.disabled")) {
				logger("Error: Failed to rename mover cron file");
			} else {
				logger("Mover schedule disabled successfully.");
			}
		} else {
			logger("Error: Mover cron file does not exist");
		}
	} else {
		// If mover schedule is enabled then rename back
		if (file_exists("/boot/config/plugins/dynamix/mover.cron.disabled")) {
			if (!rename("/boot/config/plugins/dynamix/mover.cron.disabled", "/boot/config/plugins/dynamix/mover.cron")) {
				logger("Error: Failed to rename mover cron file");
			} else {
				logger("Mover schedule enabled successfully.");
			}
		} else {
			logger("Error: Mover cron file does not exist");
		}
	}
}

And that's your error message too:

Error: Mover cron file does not exist

So something messed up with your /boot/config/plugins/dynamix/

edit: I don't know how or why this file would become corrupted since I think it's part of Unraid itself, but if for some reason you need to recreate it mover.cron is supposed to look something like this:

root@Dammerung:/boot/config/plugins/dynamix# cat mover.cron
# Generated mover schedule:
0 11 * * 2 /usr/local/sbin/mover start |& logger -t move

edit 2: Actually, I have a theory. @Masterwishx consider the following scenario:

  1. User tries running "move now" with "Disable Mover running on a schedule: Yes"

  2. This would cause:

    1. /boot/config/plugins/dynamix/mover.cron -> /boot/config/plugins/dynamix/mover.cron.disabled

  3. User uninstalls/reinstalls ca.mover.tuning.plugin

  4. mover.cron would remain as mover.cron.disabled

Could this lead to mover.cron becoming permanently disabled and then the plugin thinks it's missing?

I don't want to run this myself and screw up my shares/mover, so I'll leave this here for someone else to pick up.

Edited by ronia

1 hour ago, ronia said:

. I am not sure why this check exists,

Users on 6.x was complain that emhttp calling mover without start parameter

Edited by Masterwishx

1 hour ago, ronia said:

Could this lead to mover.cron becoming permanently disabled and then the plugin thinks it's missing?

I will check it

1 hour ago, ronia said:

become corrupted since I think it's part of Unraid itself

Changing mover scheduling will recreate cron file

2 hours ago, ronia said:

Awesome amount of work!

Thanks a lot. That an awesome amount of work you did!

I do use the cron setting of the plugin.

When I first tried to run the new version, I did see the cron error msg.

But the second time I tried it, it didn't show this msg. So I figured it was a file missing thats created on the first run or something.

This is my output when I run the crond --help command

root@Tower:~# crond --help
dillon's cron daemon 4.5
crond [-s dir] [-c dir] [-t dir] [-m user@host] [-M mailer] [-S|-L [file]] [-l level] [-b|-f|-d]
-s            directory of system crontabs (defaults to /etc/cron.d)
-c            directory of per-user crontabs (defaults to /var/spool/cron/crontabs)
-t            directory of timestamps (defaults to /var/spool/cron/cronstamps)
-m user@host  where should cron output be directed? (defaults to local user)
-M mailer     (defaults to /usr/sbin/sendmail)
-S            log to syslog using identity 'crond' (default)
-L file       log to specified file instead of syslog
-l loglevel   log events <= this level (defaults to notice (level 5))
-b            run in background (default)
-f            run in foreground
-d            run in debugging mode
32 minutes ago, Marcvz said:

When I first tried to run the new version, I did see the cron error msg.

if you see cron error message : Error: Mover cron file does not exist

this mean:

  1. you have disabled the plugin on shedule mover.cron.disabled)

  2. then you changed mover schedule time -> that recreated file to mover.cron

  3. and then you have enabled schedule but file was already mover.cron

So just enable schedule for plugiun and change cron time for Mover it will recreate `boot/config/plugins/mover.cron`

or rename it manually and run update_cron

3 minutes ago, Masterwishx said:

if you see cron error message : Error: Mover cron file does not exist

this mean:

  1. you have disabled the plugin on shedule mover.cron.disabled)

  2. then you changed mover schedule time -> that recreated file to mover.cron

  3. and then you have enabled schedule but file was already mover.cron

So just enable schedule for plugiun and change cron time for Mover it will recreate `boot/config/plugins/mover.cron`

or rename it manually and run update_cron

This are the settings I use.

I'm running the old version now but I used the same settings in the new version.

As far as I know I have the plugin enabled on schedule.


Screenshot_2025-06-13-21-15-55-772_com.android.chrome.jpg

2 minutes ago, Marcvz said:

As far as I know I have the plugin enabled on schedule.

So if you install new version with current settings you have error?

Anyway I will fix it in new version and maybe will remove this part (with renaming cron file) as another fix avaliable in last version for crond

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.