From: "Benoît Rouits" <brouits@free.fr>
To: "Mário Gamito" <gamito@gmail.com>
Cc: linux-admin@vger.kernel.org
Subject: Re: Emulate(?) the crontab
Date: Tue, 09 Jan 2007 22:34:05 +0100 [thread overview]
Message-ID: <1168378445.7063.14.camel@chimay> (raw)
In-Reply-To: <45A3EDF7.7000105@gmail.com>
Le mardi 09 janvier 2007 à 19:33 +0000, Mário Gamito a écrit :
> Hi,
[...]
> The agregator software must run a one line command every 15 minutes to
> 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/config.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
>
[...]
> I wonder if there could be written a script (bash, perl, python), that
> *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=`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.
>
> Warm Regards,
> Mário 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
next prev parent reply other threads:[~2007-01-09 21:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-09 19:33 Emulate(?) the crontab Mário Gamito
[not found] ` <430c159a0701091142t510790fdkd9c7049ff162f6d3@mail.gmail.com>
2007-01-09 19:47 ` Atishay Kumar
2007-01-09 20:47 ` Jens Knoell
2007-01-09 21:34 ` Benoît Rouits [this message]
2007-01-10 0:27 ` terry white
2007-01-10 9:41 ` Adam T. Bowen
-- strict thread matches above, loose matches on Subject: below --
2007-01-10 11:05 Adrian C.
2007-01-10 11:16 Jean M. Bouchara
2007-01-10 12:09 ` Adrian C.
2007-01-10 12:43 ` Adam T. Bowen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1168378445.7063.14.camel@chimay \
--to=brouits@free.fr \
--cc=gamito@gmail.com \
--cc=linux-admin@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.