Starting Multiple Instances

Subscribe to Starting Multiple Instances 3 post(s), 2 voice(s)

 
Avatar bitumen.surfer 8 post(s)

My objective is to start multiple instances of JBW ( for multiple eBay accounts ) and I’m trying to figure out how to do that on Linux.

At present I know that my auction/user data is saved under ~user/.jbidwatcher. What I’d like to know is whether it is possible to a) specify a different “root” for each instance on the command line (& how to do so) i.e. change ~user/.jbidwatcher to ~user/.jbidwatcher.ebay_name b) will multiple running instances co-exist on linux – i.e. no communication between themselves ?

At present, I’d settle for knowing how to specify command line options to java/JbidWatcher (sorry, bit of a java newbie)

Many thanks
J

 
Avatar Morgan Schweers Administrator 955 post(s)

Greetings,
Well… You should be able to (with JBidwatcher 2.x) pass the --usb parameter to JBidwatcher, and it will use whatever your current working directory is. (Type pwd at the shell prompt, which will tell you your working directory. JBidwatcher will try to create a .jbidwatcher directory in that location if you launch it with the --usb parameter.)

To launch JBidwatcher with that flag, you would do something like this:

bash$ java -jar JBidwatcher-2.0beta3.jar --usb

You have to make sure to disable ‘Use internal web server’ on the ‘Webserver’ tab of the Configuration Manager, because they’ll fight over the port that it listens on.

Other than that, I believe multiple instances should live in effective harmony.

Let me know if I’m wrong, or you run into any odd behavior, since that’s a pretty new feature of 2.x!

— Morgan Schweers, CyberFOX!

 
Avatar bitumen.surfer 8 post(s)

Brilliant !!! Thanks Morgan, much appreciated.

I have now created a simple shell script ( below) to launch my two (or more) instances of JBidWatcher. I have included my script in case it helps

One other minor query. Is there an official location to download the JBW icon ? If I simply use the jar file it comes with no icons and I have to select a random image for adding the shortcut to my panel or menus – Of course I could just save your icon from this conversation – but thought I’d be polite.

Thanks to the kind soul who added the coding options to my script – much appreciated
--—( my script, save as jbidwatcher.sh )

#!/bin/bash

# 1) Place this script in $HOME/bin & make executable ( chmod +x )
# 2) Place your JBidWatcher jar in $HOME/bin
# 3) Alter EBAY_IDS to reflect your ids
# 4) Either create a soft link to the jar file or alter JBW_jar below

# Java
JAVA=/usr/bin/java
JAVA_OPTS="-Xmx512m" 

# this is soft link to current version in same location
JBW_jar=$HOME/bin/JBidWatcher.jar
JBW_root=$HOME/.jbidwatcher
EBAY_IDS="id1 id2 id3 etc" 

for id in $EBAY_IDS; do
    ebay_root=$JBW_root"_"$id
    #echo $ebay_root
    cd $ebay_root

    # ideally this *should* capture the output - but doesn't (java oddity?)
    $JAVA $JAVA_OPTS -jar $JBW_jar --usb 2>&1 >| $ebay_root/session_log &
done

-