From owner-freebsd-questions@FreeBSD.ORG Fri Jun 1 19:41:22 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E6F8106566C for ; Fri, 1 Jun 2012 19:41:22 +0000 (UTC) (envelope-from jan0sch@gmx.net) Received: from mailout-de.gmx.net (mailout-de.gmx.net [213.165.64.22]) by mx1.freebsd.org (Postfix) with SMTP id D3A4C8FC0A for ; Fri, 1 Jun 2012 19:41:21 +0000 (UTC) Received: (qmail invoked by alias); 01 Jun 2012 19:41:15 -0000 Received: from dslb-088-072-245-016.pools.arcor-ip.net (EHLO magni.rostock.home) [88.72.245.16] by mail.gmx.net (mp004) with SMTP; 01 Jun 2012 21:41:15 +0200 X-Authenticated: #1545395 X-Provags-ID: V01U2FsdGVkX1/bVBBztvjbXP7Fx9aVlNGumC+AS/g1KQfrE71hj6 2OpVn0TEBCamEq Date: Fri, 1 Jun 2012 21:39:00 +0200 From: Jens Jahnke To: freebsd-questions@freebsd.org Message-Id: <20120601213900.2d0825b6.jan0sch@gmx.net> In-Reply-To: References: X-Mailer: Sylpheed 3.1.4 (GTK+ 2.24.6; amd64-portbld-freebsd9.0) X-Face: &?!P`87-36gaG)/K:yi&ixw=uy]y'?$vrc Mime-Version: 1.0 Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg="PGP-SHA512"; boundary="Signature=_Fri__1_Jun_2012_21_39_00_+0200_kKYER_BH+K2tH=UV" X-Y-GMX-Trusted: 0 Subject: Re: How to crontab screen with script inside and a "don't run it if it's already running" check? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jun 2012 19:41:22 -0000 --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 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--