Date: Fri, 1 Jun 2012 21:39:00 +0200 From: Jens Jahnke <jan0sch@gmx.net> To: 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: <20120601213900.2d0825b6.jan0sch@gmx.net> In-Reply-To: <CAOOO88D089cm7Hm00kxPTzGc6p8yHn1bBFFz_4w_JADrMK1z5w@mail.gmail.com> References: <CAOOO88D089cm7Hm00kxPTzGc6p8yHn1bBFFz_4w_JADrMK1z5w@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--Signature=_Fri__1_Jun_2012_21_39_00_+0200_kKYER_BH+K2tH=UV Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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>=20 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=3D'if pgrep -u $USER irssi;then screen -U -x irssi;else screen = -S irssi irssi;fi' Regards, Jens --=20 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 --Signature=_Fri__1_Jun_2012_21_39_00_+0200_kKYER_BH+K2tH=UV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQG8BAEBCgAGBQJPyRrZAAoJED2+SXzzbciGZiUM/iNJFirm2EYSHsJn6596v1u1 A4kuNDEyK978U6Ipl76C5IH3CMMzaV3+meuh6bzKtxHs6EwZ1YZ8yNjsWmzJxPm0 /WEsJd+LqZ3zKuZbm50YhEbndp9eZ4chY/EYEWYbgkEunzsRS29MgITGAyqCNpXn RydUnj/Dh6P/G8hQvFGpf0eNC7c3a8yQ8oji2xQorfQ5VRXeyO/RlsxmtpVqUc67 7qmNqBfzHIfU6h6MC/xAbFbbXjtBgDRvyVbZP/X5XlVyKcJ+QwKSinE+3A9xI91/ YC6X0+GWKIWDDAMGTc8Gz5daxL6E0z22iaJl9vfiek4CwiVCvKQNZRoJCu4isfnU zaHy51YN7MzKZ/iSeVqDQP8VG89l2KRVDOtKaVFwgm9T3Ept6vxrDXwsCPxl/dXo ngoKIFxuFNQOWxuB4X2Dph0mVAuucSAmfsfNvdpm7ipnhQgvJwxRPjKaNKQ+LC0D mmm1lbednzKXwMmt+F0TC31Vqhjoi05w3bC7IQ29Fr9WVA5wvj9ZdtapjCSjd+la OQpHRtLewzgoSAO1SIhx =NnyR -----END PGP SIGNATURE----- --Signature=_Fri__1_Jun_2012_21_39_00_+0200_kKYER_BH+K2tH=UV--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120601213900.2d0825b6.jan0sch>