Jump to content

Mover script should skip named pipes.


Recommended Posts

Posted

Instead of 

```

        find "${SHAREPATH%/}" -depth | /usr/local/bin/move $DEBUGGING
```

I think it should be

```

        find "${SHAREPATH%/}" -depth \( ! -type p \) | /usr/local/bin/move $DEBUGGING
```

The mover would get stuck a lot and I looked into it today. I found that it gets stuck on named pipes. IIUC it's a special file and not something that can be moved. I updated the mover script to skip the named pipes and now I'm happy.

 

I don't see the mover script in /boot, how can I make this change permanent?

 

Thanks!

 

Relevant part of the mover script below.

```

  # Check for objects to move from pools to array
  for POOL in /boot/config/pools/*.cfg ; do
    for SHAREPATH in /mnt/$(basename "$POOL" .cfg)/*/ ; do
      SHARE=$(basename "$SHAREPATH")
      if grep -qs 'shareUseCache="yes"' "/boot/config/shares/${SHARE}.cfg" ; then
        find "${SHAREPATH%/}" -depth \( ! -type p \) | /usr/local/bin/move $DEBUGGING
      fi
    done
  done

  # Check for objects to move from array to pools
  ls -dvc1 /mnt/disk[0-9]*/*/ | while read SHAREPATH ; do
    SHARE=$(basename "$SHAREPATH")
    if grep -qs 'shareUseCache="prefer"' "/boot/config/shares/${SHARE}.cfg" ; then
      eval $(grep -s shareCachePool "/boot/config/shares/${SHARE}.cfg" | tr -d '\r')
      if [[ -z "$shareCachePool" ]]; then
        shareCachePool="cache"
      fi
      if [[ -d "/mnt/$shareCachePool" ]]; then
        find "${SHAREPATH%/}" -depth \( ! -type p \) | /usr/local/bin/move $DEBUGGING
      fi
    fi
  done
```

 

Posted

I copied stuff to the array from an unassigned device. I have a cache pool and the mover runs on a schedule and moves from the cache pool to the array. I'd like to be able to kick off the initial copy from the unassigned device and come back to see it has been moved to the array. Currently, I kick off the copy and then come back to a stuck mover that I need to kill.

Should I just edit my /boot/config/go file to create a custom mover script in /root/.local/bin/ ?

Posted
3 minutes ago, NominallySavvyTechPerson said:

Should I just edit my /boot/config/go file to create a custom mover scrip

no, just do the copy without cache. use a tool like unbalanced and select a "diskX" as the target. this will avoid the fuse filesystem and the cache. Of course, copy will be much slower, but overall the time consumption will be the same

Still not convinced that these kind of files belongs to an unraid share... will surely give trouble someday / elsewhere. Maybe the used filesystem even does not support this type and, most likely, the file permissions set to nobody/nobody will not work too... But you have to know what it is good for...

 

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...