Shell script/bat question


Recommended Posts

Hi all sorry if i dont make much sense or anything but im a PC lol.

Anyway what i wanted to know is, is it possible to make a bat/shell script to unzip/rar a file then move ALL files with the file types avi, mkv etc etc to another directory on a network extenstion (router with readyshare)

So thats find files with rar/zip etc

Unzip them then remove zip/rar files

Find avi/mkv etc

Move to readyshare

Its just to make things easier for my dad, brought a mac wants media streaming then im asked to come and figire it all out -.-

Anny help, advise etc is appreciated.

Link to comment
Share on other sites

Surely Double Click the ZIP files and drag and drop into Share is easier that creating a script and having him go into Terminal to execute it?! Still, it can be done, but I'm not on my Mac right now, so I'll have a solution later.

Link to comment
Share on other sites

I was thinking it would be like a bat file you double click and it just worked, if terminal is needed then forget it lol

I have had a look at automator but i dont really know how to combine a search and when i have tried results have gone from x found to 0 found then i dont know how to uncompress the files anyhow :/ something i have been thinking was maybe doing everything seperate "search rar > expand", "search zip > expand", search rar delete rar search zip etc etc. just thought with todays technology it be simple "kind: rar,zip", "delete: rar,zip" i'll keep looking into it in my spare time.

Thanks for the responses anyhow.

Link to comment
Share on other sites

OK... Let me just think outloud here...

1) Extracting zip files is easy, so let's ignore that.

2) You only want to copy certain files from wherever they are in a folder structure to 1 folder elsewhere? I'm no expert in RoboCopy but I assume it can do that?

I'd personally write a small C# exe for the task on a Windows PC...

Link to comment
Share on other sites

Hi Nik, everything i need to do is in a Mac enviroment not Windows, if it was Windows i would of had it done i recon. Anyway going to run over to the mac and have a play see how far i get till i hit that brick wall lol

Link to comment
Share on other sites

No problem Nik its probably because i added "bat" to the tagline/title

Anyway, ive just done more research and believe i have it doing what i initially wanted! Im just running a few tests to make sure, i think my main issues were i was trying to make it too complecated and do too much too fast, anyway ive now split the search patters and extracting and like i said im testing.

1. search for extension rar

2. extract rar files > delete rar files

3. search for extension zip

4. extract zipfiles > delete

Automator is pretty simple when you figure things out, for extraction im using "The Unarchiver"

Thanks for the responses anyway people appreciated!

Pah no edit button for (Solved) well i hope it is anyhow ^^

Link to comment
Share on other sites

This topic is now closed to further replies.