Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Command line instructions on Minimwatch
23-06-2021, 12:53
Post: #1
Command line instructions on Minimwatch
Hi, sorry if this already exists and I have missed it.
Why do I want it?
Well - and I am not an expert here - I use a simple routine on my Mac PC which I use to transfer files. I will explain my process:

I rip CDs &c to an external hard drive, "Don6Tb". This acts as my backup and where I modify and update metadata.

I then use a *.sh file on my desk top to transfer the new and modified FLACs to my NAS, which happens to be a Melco, but the system, using rsync would work to any storage device.

So my *.sh file is

================================
#!/bin/bash

rsync -avh --progress /Volumes/Don6Tb/MAIN/ /Volumes/share/MAIN 2> ~/Desktop/rsyncErrorsMELCO.txt

================================

Volumes/Don6Tb/MAIN/ is where I keep my music collection on my hard disk, and Volumes/share/MAIN is my NAS (Melco).

The last bit ~/Desktop &c simply creates an errors file. Never seems necessary.

Now it would be nice to be able to add to my *.sh file something like:

================================
open /Applications/Minimwatch.app/Contents/ blah blah rescan /Volumes/share/MAIN

================================

This would mean that my NAS (Melco) would be automatically updated every time I added a file to it. At the moment I have to remember to run Minimwatch - Rescan after adding files.

A similar process could be developed by Windows users using a batch file and XCopy.

Sorry for being out of my depth but it would be nice to add this. Certainly the rsync routine works brilliantly and quickly.

Cheers
Donuk sunny downtown York
Find all posts by this user
Quote this message in a reply
23-06-2021, 14:31
Post: #2
RE: Command line instructions on Minimwatch
I think mscript is what you're looking for.

It seems that you select a profile (if necessary) and then perform a rescan, rather than giving it a path/content directory (as per your example).
Find all posts by this user
Quote this message in a reply
23-06-2021, 17:43
Post: #3
RE: Command line instructions on Minimwatch
Thanks simbun for you helpful response.
I am afraid I am going to ask you to lead me by the hand a bit here.

I have run this in Terminal on my Mac, and get the reply

/Applications/MinimWatch.app/Contents/mscript -a 192.168.0.7:9790 rescan

It says Server not available

If I put this address in my browser I bring up the Minimserver Page fine. So the address is OK?

What else can I try?

Cheers Donuk
Find all posts by this user
Quote this message in a reply
23-06-2021, 20:27
Post: #4
RE: Command line instructions on Minimwatch
When I try the command you have posted, I get "Script file not found: rescan".

This is because you can't put "rescan" on the command line like this. The command-line argument is the name of a script file, so you can create a script file named (for example) rescan.txt containing a single line "rescan" and put the path to this script file in the command.
Find all posts by this user
Quote this message in a reply
23-06-2021, 20:35
Post: #5
RE: Command line instructions on Minimwatch
I don't actually use this myself, but I've quickly had a go from MinimWatch on Win 10 to Ubuntu and got a rescan working.
I don't think you can pass 'rescan' directly, it needs to be in a script/text file. My command was simply:

Code:
mscript -a 192.168.20.10:9790 script.txt

So I'm not sure why yours isn't working.
Find all posts by this user
Quote this message in a reply
23-06-2021, 23:17
Post: #6
RE: Command line instructions on Minimwatch
Brilliant simbun!!
I did what you said and it works. This is the full content of my desktop Mac "batch file" called NAS.sh

================================
#!/bin/bash

rsync -avh --progress /Volumes/Don6Tb/MAIN/ /Volumes/share/MAIN 2> ~/Desktop/rsyncErrorsMELCO.txt

/Applications/MinimWatch.app/Contents/mscript -a 192.168.0.7:9790 /Applications/MinimWatch.app/Contents/rescan.txt

=================================
I made a txt file with just the word rescan in it, and popped it into the Minimwatch app Contents folder for safe keeping. Now when I run the NAS.sh file it moves all new and updated files to the Melco and then rescans. It is possible to see it doing this via Minimwatch- Show Log - verbose.

Thanks again.
Donuk Happy Downtown York
Find all posts by this user
Quote this message in a reply
24-06-2021, 13:59
Post: #7
RE: Command line instructions on Minimwatch
A further little thought....

How about if the Minimwatch app came complete with a little text file in the Contents directory called rescan.txt and contained just the word rescan.

This would be very small and save folk like me having to create one.

Donuk beautiful downtown York.
Find all posts by this user
Quote this message in a reply
24-06-2021, 16:11
Post: #8
RE: Command line instructions on Minimwatch
(24-06-2021 13:59)Donuk Wrote:  How about if the Minimwatch app came complete with a little text file in the Contents directory called rescan.txt and contained just the word rescan.

Would you also want a file for restart/relaunch e.t.c.?

If you only want to run a single console command then it's probably easier if you just pipe it to mscript:

Code:
echo "rescan" | /Applications/MinimWatch.app/Contents/mscript -a 192.168.0.7:9790

Should work.
Find all posts by this user
Quote this message in a reply
24-06-2021, 21:32
Post: #9
RE: Command line instructions on Minimwatch
The piped echo command is the best way to do this at present. In a future version, I am thinking of adding a new option -c to specify a single command to run.
Find all posts by this user
Quote this message in a reply
24-06-2021, 23:06
Post: #10
RE: Command line instructions on Minimwatch
It works. You two are brilliant.
Another dumb question - what subject do I have to learn to learn about this sort of stuff? Piping and these command lines. Is it Unix or what?

Donuk Impressed of downtown York
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)