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.

Moving files from cache using a mv/cp script?

Featured Replies

I have a share (lets call it Source) which is set to 'use cache: yes'. Once the mover runs, it is moved to the array.

Sometimes I use scrips to move files around across shares; e.g. (mv /mnt/user/Source/foo.img /mnt/user/Destination/bar.img).

Destination is set up not to use the cache, but if the script runs while the file is located on the cache, it will end creating a Folder called "Destination" on the cache and moving the file there. Resulting in an orphaned File :(

How do I prevent that, or what kind of scripting do I have to use here?

  • Community Expert

Linux sees all user shares as being mounted on the same device, so when you try to move from one to the other it just renames it so it has a different path. You can copy the files instead of moving then it will use the settings of the destination share to decide where to put the file, and then you can delete it from the source.

  • Author

I see the point, but 90% of the time moving is correct as the files are on the array. So creating that kind of overhead seems not correct and takes way longer.

Maybe I could add a check if the file(s) are still on the cache? No idea if/how it is possible.

  • Community Expert
1 hour ago, Jaster said:

I see the point, but 90% of the time moving is correct as the files are on the array. So creating that kind of overhead seems not correct and takes way longer.

Maybe I could add a check if the file(s) are still on the cache? No idea if/how it is possible.

Why not set the 'Destination' to also have Cache=Yes?     That way the move of a file that is on the cache will be virtually instantaneous, and later mover will move it to the array.

 

One thing that might help you if you want to be clever is to utilise the fact that /mnt/user0 only shows files that are on the main array, while /mnt/user shows files that are on the array or the cache.   Any difference would imply a file that is only on the cache.  Also there is nothing to stop you checking /mnt/cache which is a direct reference to the physical cache drive by-passing the User Share level.

  • Community Expert
2 hours ago, Jaster said:

So creating that kind of overhead...takes way longer.

Moving between disks is a copy followed by a delete anyway so I don't know why you say it would take longer.

 

itimpi has some good ideas up there.

Archived

This topic is now archived and is closed to further replies.

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.