Page 1 of 1

synology cli shell script - video files only - ignore images???

Posted: 09 Sep 2019, 03:59
by psybertech
Greetings.

Big fan and I've had a yearly sub for a few years now and finally pulled the trigger on the lifetime! :D

I've just started using the CLI for my Synology NAS after learning it was also available there (wish I would have looked YEARS AGO!!! haha)... been using the Windows UI for a while.

But is there a way in the Synology CLI to only rename video files and ignore image files?

Ideally, I just want the rename to occur on vidz so I don't end up with abandoned image files from whatever scraper/app/media server that will create them when the file name doesn't match (i.e. Plex or Emby). Its easier to clean up the non-renamed files when they are different. Yeah... I know... splitting hairs at this point. :mrgreen:
If I could just rename the video files, I'd be happy.

Yes, I can script a 'find . -name ' regex this ... or a 'for i in *.blah'... whatever and pass results (which I will do for my shell script -which would be much better anyway since I could handle the images and remove them so the server can just re-fetch new ones), but is there a switch I am missing to simplify this for one off CLI runs?

OH, and while I am asking.. same thing for .nfo files and subs? Maybe a global -video-files-only switch???? I guy can dream, right? haha

Thanks in advance!

j

Re: synology cli shell script - video files only - ignore images???

Posted: 11 Sep 2019, 05:53
by rednoah
1.
psybertech wrote:
09 Sep 2019, 03:59
But is there a way in the Synology CLI to only rename video files and ignore image files?
I'm pretty sure that that's default behaviour.

:?: What have you tried so far? What did the console output say?


2.
find is a fine solution on Mac and Linux, but if you're on Windows, or if you need more complex file selection logic, then the --file-filter option will do the trick:
viewtopic.php?t=4222

Code: Select all

--file-filter f.video

Re: synology cli shell script - video files only - ignore images???

Posted: 11 Sep 2019, 15:40
by psybertech
@rednoah,

Yeah, I understand renaming the images and nfo files is the default behavior.

But, Thank you!
--file-filter f.video worked perfectly and was I was looking for!

Thanks again.

j