Re: singleton for script with shebang

2015-01-04 Thread Ole Tange
On Sat, Jan 3, 2015 at 10:09 PM, Bradley b...@customweather.com wrote: On Jan 3, 27 Heisei, at 11:21 AM, Ole Tange o...@tange.dk wrote: On Fri, Jan 2, 2015 at 8:53 PM, Bradley Asztalos b...@customweather.com wrote: On Fri, Jan 2, 2015 at 7:35 AM, Ole Tange o...@tange.dk wrote: On Fri, Jan 2,

Re: singleton for script with shebang

2015-01-04 Thread Bradley Asztalos
Ole, RobberA is robbing a bank and posts her accomplice, RobberB, outside the door to keep watch. Independently, RobberC arrives on the scene to rob the bank as well, noticing that the bank is being robbed, she takes off and vows to give up her life of crime. Compare: RobberAB finish their hard

Re: singleton for script with shebang

2015-01-02 Thread Bradley Asztalos
Ole, No, I did not say anything about Shlomi being right, just that you are clever, in the good sense. To me it is great to be able to use shebang, and it is not overly clever at all, in the bad sense. I often use the /usr/bin/timeout command and parallel + a command + arguments in crontab

Re: singleton for script with shebang

2015-01-02 Thread Bradley
Thanks for the reply, see ole's clever response On Jan 1, 27 Heisei, at 11:14 PM, Shlomi Fish shlo...@shlomifish.org wrote: Hi Bradley, On Thu, 1 Jan 2015 13:54:57 -0800 Bradley Asztalos b...@customweather.com wrote: I have a simple script, foo.sh:: #!/bin/bash echo start $$

Re: singleton for script with shebang

2015-01-02 Thread Bradley
Agreed Doh! On Jan 2, 27 Heisei, at 12:48 AM, Ole Tange o...@tange.dk wrote: On Thu, Jan 1, 2015 at 10:54 PM, Bradley Asztalos b...@customweather.com wrote: But I'm wondering if it is possible to use shebang in this context as in: It is. ---singleton.sh-

Re: singleton for script with shebang

2015-01-02 Thread Ole Tange
On Thu, Jan 1, 2015 at 10:54 PM, Bradley Asztalos b...@customweather.com wrote: But I'm wondering if it is possible to use shebang in this context as in: It is. ---singleton.sh- #!/opt/local/bin/parallel --shebang-wrap /bin/bash --semaphore --fg -u --id lock_id echo start $$

Re: singleton for script with shebang

2015-01-02 Thread Bradley Asztalos
Ole, No problem, I realized that it was rhetorical after I wrote the response. Cheers Shlomi and Ole and thank you for the help. Cheers, Bradley On Fri, Jan 2, 2015 at 2:15 AM, Ole Tange o...@tange.dk wrote: On Fri, Jan 2, 2015 at 11:07 AM, Bradley Asztalos b...@customweather.com wrote:

Re: singleton for script with shebang

2015-01-01 Thread Shlomi Fish
Hi Bradley, On Thu, 1 Jan 2015 13:54:57 -0800 Bradley Asztalos b...@customweather.com wrote: I have a simple script, foo.sh:: #!/bin/bash echo start $$ sleep 10 echo end $$ I can run make sure this runs as a singleton with sem --fg -u --id lock_id ./foo.sh But I'm wondering if it

singleton for script with shebang

2015-01-01 Thread Bradley Asztalos
I have a simple script, foo.sh:: #!/bin/bash echo start $$ sleep 10 echo end $$ I can run make sure this runs as a singleton with sem --fg -u --id lock_id ./foo.sh But I'm wondering if it is possible to use shebang in this context as in: ---singleton.sh- #!/opt/local/bin/parallel