Posted November 17, 201113 yr I have files that I would like to remain on the cache drive as it is never spun down, but they need to remain in the directory structure they are currently in so I can't simply move them to a directory starting with "." or "_". Is there a way in which I could modify the mover script to exclude moving particular files? I imagine I just make a change somewhere in this line, especially in the regex part: \( -type f -regex '[.]/[^.].*/.*' ! -exec fuser -s {} \; -exec touch /tmp/mover.sync \; \ -print -exec rsync -i -dIWRpEAXogt --numeric-ids --inplace --remove-source-files {} /mnt/user0/ \; \) -o \ Thanks for any help
November 17, 201113 yr I have files that I would like to remain on the cache drive as it is never spun down, but they need to remain in the directory structure they are currently in so I can't simply move them to a directory starting with "." or "_". Is there a way in which I could modify the mover script to exclude moving particular files? I imagine I just make a change somewhere in this line, especially in the regex part: \( -type f -regex '[.]/[^.].*/.*' ! -exec fuser -s {} \; -exec touch /tmp/mover.sync \; \ -print -exec rsync -i -dIWRpEAXogt --numeric-ids --inplace --remove-source-files {} /mnt/user0/ \; \) -o \ Thanks for any help You told us almost nothing about what you are trying to keep on the cache drive. If you are using a newer beta you can designate a folder as a "cache only" share and it will be ignored and not moved off the cache drive.
November 17, 201113 yr I have files that I would like to remain on the cache drive as it is never spun down, but they need to remain in the directory structure they are currently in so I can't simply move them to a directory starting with "." or "_". Is there a way in which I could modify the mover script to exclude moving particular files? I imagine I just make a change somewhere in this line, especially in the regex part: No, you would not touch the regex part. You could potentially add -prune options for specific files.
November 17, 201113 yr Author -prune looks like it will do the trick, thanks. Basically I want to keep metadata files on cache so I'm not unnecessarily spinning up drives. However, they all need to remain in the directory housing the files so I can't put them into a cache only share. Thanks
November 22, 201113 yr Author Well, -prune doesn't help my situation (would exclude directories not files, could accomplish that with a leading . or _). It did however lead me on the path to find my solution, thank you. Here is what I did in case anyone else is wanting to accomplish a similar task: Original: (cd /mnt/cache ; find -depth \ \( -type f -regex '[.]/[^.].*/.*' ! -exec fuser -s {} \; -exec touch /tmp/mover.sync \; \ -print -exec rsync -i -dIWRpEAXogt --numeric-ids --inplace --remove-source-files {} /mnt/user0/ \; \) -o \ \( -type d -regex '[.]/[^.].*' \ -print -exec rsync -i -dIWRpEAXogt --numeric-ids --inplace {} /mnt/user0/ \; -empty -delete \) \ ) Modified: (cd /mnt/cache ; find -depth \ \( -type f \( -regex '[.]/[^.].*/.*' -a ! -name '*.png' \) ! -exec fuser -s {} \; -exec touch /tmp/mover.sync \; \ -print -exec rsync -i -dIWRpEAXogt --numeric-ids --inplace --remove-source-files {} /mnt/user0/ \; \) -o \ \( -type d -regex '[.]/[^.].*' \ -print -exec rsync -i -dIWRpEAXogt --numeric-ids --inplace {} /mnt/user0/ \; -empty -delete \) \ ) (only line 2 has changed) This will leave all files named *.png in their location on the cache drive. This allows them however to stay in the same path (as seen by user shares) as associated files. The purpose being that I need the *.png files in the same directory as the video files or whatever that are in my user shares (due to requirements of my video library software) but I don't want my drives spinning up all the time to access just the images when I'm just trying to browse the library. All the images remain on the cache drive so I only have to have a single drive spinning. This also serves for much faster browsing since you don't need all the drives spun or in my case the cache drive is never spun down.
Archived
This topic is now archived and is closed to further replies.