Unix based Script with Cygwin?

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
Veepas
Posts: 3
Joined: 01 Jan 2016, 21:28

Unix based Script with Cygwin?

Post by Veepas »

Hello dear Filebot Community,

i'm trying to work out a script to automate the rename process for my tv shows.
I'm on Win 10 and Filebot 4.6.1 installed with the Win installer.

Now i found a script that should work for me but unfortunately it is written for a Unix based System but not for Windows. :(
Can you tell me what changes are needed to make this work on Windows ?

Here is my Script:

Code: Select all

#!/bin/sh

BaseDir="Z:\video\SERIEN\"

DownloadFolderTVde="Z:\admin\download\complete"

Serie="{n.replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\").replace(':',' -')}"

Titel="{t.replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\").replace(':',' -')}"

setfacl -Rb "${DownloadFolderTVde}"

chown root:users "${DownloadFolderTVde}" -R

find "${DownloadFolderTVde}" -type d -exec chmod 775 {} +

find "${DownloadFolderTVde}" -type f -exec chmod 664 {} +

filebot -rename "${DownloadFolderTVde}" --db thetvdb --format "${BaseDir}/${Serie}/Staffel {s} DE + EN {vf}/${Serie} - {s00e00} - ${Titel}" -non-strict -r --override auto

filebot -script fn:cleaner "${DownloadFolderTVde}"

find "${BaseDir}" -type d -exec chmod 775 {} +

find "${BaseDir}" -type f -exec chmod 664 {} +
In the end this should automate in cooperation with sabnzbd. So when Sabnzbd finished the download Filebot should do the rest.
I hope u can help me i really appreciate any help

Greetings Veepas :)
Last edited by Veepas on 07 Jan 2016, 16:04, edited 1 time in total.
Veepas
Posts: 3
Joined: 01 Jan 2016, 21:28

Re: Convert Unix Script to Windows??

Post by Veepas »

Is there noone who can help me ?
Could somebody at least explain me how to write a script that would work in Windows ?

Lets say i use this code what else would i need to make this work ?

Code: Select all

BaseDir="Z:\video\SERIEN\"

DownloadFolderTVde="Z:\admin\download\complete"

Serie="{n.replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\").replace(':',' -')}"

Titel="{t.replaceAll(/[!?.]+\$/).replaceAll(/[\`´‘’ʻ]/, \"'\").replace(':',' -')}"

setfacl -Rb "${DownloadFolderTVde}"

chown root:users "${DownloadFolderTVde}" -R

find "${DownloadFolderTVde}" -type d -exec chmod 775 {} +

find "${DownloadFolderTVde}" -type f -exec chmod 664 {} +

filebot -rename "${DownloadFolderTVde}" --db thetvdb --format "${BaseDir}/${Serie}/Staffel {s} DE + EN {vf}/${Serie} - {s00e00} - ${Titel}" -non-strict -r --override auto

filebot -script fn:cleaner "${DownloadFolderTVde}"
Also my drive Z is a NAS do i need to make it look like 192.168.178.43:\video\SERIEN\ ???

Hope somebody knows what to do

Thanks guys
User avatar
rednoah
The Source
Posts: 23953
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

Re: Convert Unix Script to Windows??

Post by rednoah »

You can't just "convert" a BASH script to Windows CMD.

The bash script makes use of tools and features that don't exist in Windows CMD, and thus it'd be extremely time consuming to rewrite the script for Windows CMD, and it might not even be possible at all because that's how much Windows CMD sucks.
:idea: Please read the FAQ and How to Request Help.
Veepas
Posts: 3
Joined: 01 Jan 2016, 21:28

Re: Convert Unix Script to Windows??

Post by Veepas »

What about using Cygwin with this script does it work that way ? i think i will give that a try
problem is i really depend on Windows but i also need Scripts to work :(
Post Reply