From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Beno=EEt?= Rouits Subject: Re: Emulate(?) the crontab Date: Tue, 09 Jan 2007 22:34:05 +0100 Message-ID: <1168378445.7063.14.camel@chimay> References: <45A3EDF7.7000105@gmail.com> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <45A3EDF7.7000105@gmail.com> Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="utf-8" To: =?ISO-8859-1?Q?M=E1rio?= Gamito Cc: linux-admin@vger.kernel.org Le mardi 09 janvier 2007 =C3=A0 19:33 +0000, M=C3=A1rio Gamito a =C3=A9= crit : > Hi, [...] > The agregator software must run a one line command every 15 minutes t= o=20 > rebuild the index.html of the site. If you have a remote shell access with a "root" account, you do can edit the system crontab. Edit file /etc/crontab and put a line like the following, with the hope this is not a standard old cron but a Vixie cron thus allowing 15 minutes: */15 * * * * root /ACCESS/TO/planet.py /ACCESS/TO/geek/fancy/conf= ig.ini if you have only a webmaster account, edit your own crontab with command "crontab -e" and do not put the "root" field. > The command is > #planet.py geek/fancy/config.ini >=20 [...] > I wonder if there could be written a script (bash, perl, python), tha= t=20 > *without crontab* could run the command I need. A nice choice is a "while" loop and a "sleep" inside it. for instance: edit file looplanet.sh: #!/bin/sh SECONDS=3D`expr 60 \* 15` while true do /ACCESS/TO/planet.py /ACCESS/TO/geek/fancy/config.ini sleep $SECONDS done #end of file then "chmod" it to make it read+executable: bash [~/bin] # chmod 755 looplanet.sh then launch it with "nohup" or "setsid" and ensure it can run once you are logged out. bash [~/bin] # nohup ./looplanet.sh & [...nohup telling where it stores output] bash [~/bin] # exit > Any help would be appreciated. Hope the above helped. There is no more way regarding given infos. >=20 > Warm Regards, > M=C3=A1rio Gamito > - > To unsubscribe from this list: send the line "unsubscribe linux-admin= " in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe linux-admin" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html