Date: Sat, 2 Jun 2012 10:59:09 +0200 From: Dwayne Henderson <its.code.in.here@gmail.com> To: Jens Jahnke <jan0sch@gmx.net> Cc: freebsd-questions@freebsd.org Subject: Re: How to crontab screen with script inside and a "don't run it if it's already running" check? Message-ID: <CAOOO88CPU2z7GSickCz3%2BEQhXTjEN8iWNxdUA1JNf=yq2wbaaA@mail.gmail.com> In-Reply-To: <20120601213900.2d0825b6.jan0sch@gmx.net> References: <CAOOO88D089cm7Hm00kxPTzGc6p8yHn1bBFFz_4w_JADrMK1z5w@mail.gmail.com> <20120601213900.2d0825b6.jan0sch@gmx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Hello Jens! Nice. But what to do if the machine reboots or whatever. Would you crontab your new Irssi alias? --Dwayne On Fri, Jun 1, 2012 at 9:39 PM, Jens Jahnke <jan0sch@gmx.net> wrote: > Hi, > > On Fri, 1 Jun 2012 20:55:00 +0200 > Dwayne Henderson <its.code.in.here@gmail.com> wrote: > > DH> I run this Ruby script 24/7 (records data from this live stream). > DH> It runs inside a screen though, so it's easy to check in on it > DH> every once in a while. > DH> > DH> But how do I crontab the screen with the script inside it? It has > DH> to be with a "don't run it if it's already running" check. > DH> [...] > > maybe you should create a shell alias. I do the following for my irssi > session: > > # Start irssi within screen or switch to it if it is already running. > alias irssi='if pgrep -u $USER irssi;then screen -U -x irssi;else screen > -S irssi irssi;fi' > > Regards, > > Jens > > -- > 01. Brachet 2012, 21:37 > Homepage : http://www.jan0sch.de > > It is a sobering thought that when Mozart was > my age, he had been dead for 2 years. > -- Tom Lehrer >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOOO88CPU2z7GSickCz3%2BEQhXTjEN8iWNxdUA1JNf=yq2wbaaA>