linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Emulate(?) the crontab
@ 2007-01-09 19:33 Mário Gamito
       [not found] ` <430c159a0701091142t510790fdkd9c7049ff162f6d3@mail.gmail.com>
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Mário Gamito @ 2007-01-09 19:33 UTC (permalink / raw)
  To: linux-admin

Hi,

I have this blog agregator in http://www.planetgeek.org

It is hosted, i. e., i'm paying for the hosting.

The agregator software must run a one line command every 15 minutes to 
rebuild the index.html of the site.

The command is
#planet.py geek/fancy/config.ini

It represents no stress at all for the server.

Meanwhile, i've asked the support to insert the line in the crontab.

Now, they want me to pay 29 euros a month for that line in the crontab.
It's outrageous. It's twice than the hosting cost itself.

I wonder if there could be written a script (bash, perl, python), that 
*without crontab* could run the command I need.

Any help would be appreciated.

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Emulate(?) the crontab
       [not found] ` <430c159a0701091142t510790fdkd9c7049ff162f6d3@mail.gmail.com>
@ 2007-01-09 19:47   ` Atishay Kumar
  0 siblings, 0 replies; 10+ messages in thread
From: Atishay Kumar @ 2007-01-09 19:47 UTC (permalink / raw)
  To: Mário Gamito; +Cc: linux-admin

It bounced back..hence sending again

On 1/10/07, Atishay Kumar <atishay.kumar@gmail.com> wrote:
> Yes Mario, I think you can do it.
>
> All you need to write a shell script which will wait run this command in a loop. The should contain logic to wait for 15 mins for every iteration.
>
> example
>
> while true
>       do
>              command
>              sleep 37  # Put whatever time you want. It should 15*60 for 15 mins.
>      done
>
>
> I hope that helps
>
> cheers/atishay
>
>
>
> On 1/10/07,  Mário Gamito <gamito@gmail.com> wrote:
> >  Hi,
> >
> > I have this blog agregator in http://www.planetgeek.org
> >
> > It is hosted, i. e., i'm paying for the hosting.
> >
> > The agregator software must run a one line command every 15 minutes to
> > rebuild the index.html of the site.
> >
> > The command is
> > #planet.py geek/fancy/config.ini
> >
> > It represents no stress at all for the server.
> >
> > Meanwhile, i've asked the support to insert the line in the crontab.
> >
> > Now, they want me to pay 29 euros a month for that line in the crontab.
> > It's outrageous. It's twice than the hosting cost itself.
> >
> > I wonder if there could be written a script (bash, perl, python), that
> > *without crontab* could run the command I need.
> >
> > Any help would be appreciated.
> >
> > 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
> >
>
>
>
> --
> Atishay Kumar



-- 
Atishay Kumar
-
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Emulate(?) the crontab
  2007-01-09 19:33 Mário Gamito
       [not found] ` <430c159a0701091142t510790fdkd9c7049ff162f6d3@mail.gmail.com>
@ 2007-01-09 20:47 ` Jens Knoell
  2007-01-09 21:34 ` Benoît Rouits
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Jens Knoell @ 2007-01-09 20:47 UTC (permalink / raw)
  To: Mário Gamito; +Cc: linux-admin

Hi Mario

On 01/09/2007 12:33 PM, Mário Gamito wrote:
> Hi,
>
> I have this blog agregator in http://www.planetgeek.org
>
> The agregator software must run a one line command every 15 minutes to 
> rebuild the index.html of the site.
>
> 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.
Yes and no. You could - depending on the hosting solution - write a 
script that runs in an endless loop and does a sleep() and set it as a 
background process. The big issue there is that a server reboot will 
kill that process. There are sneaky ways around that, like for example 
checking if the process is running - each time a user hits your page, a 
script launches to see if the endless job is running. If not - restart it.

Alternatively if you have shell access you can run a timed process on a 
different machine which for example uses SSH to hop on to the host, runs 
the process and backs off. If you have a server or 24/7 machine at home 
for example that would work just fine.

Either solution would be reasonably feasible.

Jen
-
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Emulate(?) the crontab
  2007-01-09 19:33 Mário Gamito
       [not found] ` <430c159a0701091142t510790fdkd9c7049ff162f6d3@mail.gmail.com>
  2007-01-09 20:47 ` Jens Knoell
@ 2007-01-09 21:34 ` Benoît Rouits
  2007-01-10  0:27 ` terry white
  2007-01-10  9:41 ` Adam T. Bowen
  4 siblings, 0 replies; 10+ messages in thread
From: Benoît Rouits @ 2007-01-09 21:34 UTC (permalink / raw)
  To: Mário Gamito; +Cc: linux-admin

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Emulate(?) the crontab
  2007-01-09 19:33 Mário Gamito
                   ` (2 preceding siblings ...)
  2007-01-09 21:34 ` Benoît Rouits
@ 2007-01-10  0:27 ` terry white
  2007-01-10  9:41 ` Adam T. Bowen
  4 siblings, 0 replies; 10+ messages in thread
From: terry white @ 2007-01-10  0:27 UTC (permalink / raw)
  To: linux-admin

... ciao:

: on "1-9-2007" "Mário Gamito" writ:
: blog agregator in http://www.planetgeek.org
: agregator must run every 15 minutes

    all that suggests, you have execute permission.  if you can run it
once, then you can 'wrap it in a script' that handles the invocation and
timing issues.

    finally, the webpage could check to see if the script running, and if
not, invoke it.

    all that assumes you don't have a local cron facility ...


-- 
... i'm a man, but i can change,
    if i have to , i guess ...

-
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Emulate(?) the crontab
  2007-01-09 19:33 Mário Gamito
                   ` (3 preceding siblings ...)
  2007-01-10  0:27 ` terry white
@ 2007-01-10  9:41 ` Adam T. Bowen
  4 siblings, 0 replies; 10+ messages in thread
From: Adam T. Bowen @ 2007-01-10  9:41 UTC (permalink / raw)
  To: Mário Gamito; +Cc: linux-admin

Hi,

Mário Gamito wrote:
> The agregator software must run a one line command every 15 minutes to
> rebuild the index.html of the site.
> 
> The command is
> #planet.py geek/fancy/config.ini
> 
> It represents no stress at all for the server.
> 
> Meanwhile, i've asked the support to insert the line in the crontab.
> 
> Now, they want me to pay 29 euros a month for that line in the crontab.
> It's outrageous. It's twice than the hosting cost itself.
> 
> I wonder if there could be written a script (bash, perl, python), that
> *without crontab* could run the command I need.

Another option is to use a web based cron service.  Search on google for
webcron.  I haven't used any of them so I can't comment on how well they
work.

Cheers

Adam

-
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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Emulate(?) the crontab
@ 2007-01-10 11:05 Adrian C.
  0 siblings, 0 replies; 10+ messages in thread
From: Adrian C. @ 2007-01-10 11:05 UTC (permalink / raw)
  To: linux-admin, Adam T. Bowen

Hello,

I guess you could run something like this in the background..

#!/bin/bash
until false
do
  planet.py geek/fancy/config.ini
  sleep 900
done
exit 0

--Adrian

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Emulate(?) the crontab
@ 2007-01-10 11:16 Jean M. Bouchara
  2007-01-10 12:09 ` Adrian C.
  0 siblings, 1 reply; 10+ messages in thread
From: Jean M. Bouchara @ 2007-01-10 11:16 UTC (permalink / raw)
  To: linux-admin


Put the command in /etc/inittab:


ap:3:respawn:/usr/local/bin/my_script.sh
or
ap:3:respawn:/bin/su - someuser -c /usr/local/bin/my_script.sh



> Hello,

>
> I guess you could run something like this in the background..
>
> #!/bin/bash
> until false
> do
>   planet.py geek/fancy/config.ini
>   sleep 900
> done
> exit 0
>
> --Adrian
> -
> 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
>


-- 
Jean Michel Bouchara
Completo Tecnologia Ltda. - http://www.completo.com.br/
Fone / Fax: (0xx11) 3081-3644
--
Visite o site http://www.escrevinhadora.com.br/



^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: Emulate(?) the crontab
  2007-01-10 11:16 Emulate(?) the crontab Jean M. Bouchara
@ 2007-01-10 12:09 ` Adrian C.
  2007-01-10 12:43   ` Adam T. Bowen
  0 siblings, 1 reply; 10+ messages in thread
From: Adrian C. @ 2007-01-10 12:09 UTC (permalink / raw)
  To: jean; +Cc: linux-admin


I seriously doubt that would work as our guy here is not root, thus the
question asked.

# ls -l /etc/inittab
-rw-r--r--  1 root root 2464 2002-05-07 07:45 /etc/inittab 


--Adrian



-----Original Message-----
From: linux-admin-owner@vger.kernel.org
[mailto:linux-admin-owner@vger.kernel.org] On Behalf Of Jean M. Bouchara
Sent: Wednesday, January 10, 2007 13:16 PM
To: linux-admin@vger.kernel.org
Subject: Re: Emulate(?) the crontab


Put the command in /etc/inittab:


ap:3:respawn:/usr/local/bin/my_script.sh
or
ap:3:respawn:/bin/su - someuser -c /usr/local/bin/my_script.sh



> Hello,

>
> I guess you could run something like this in the background..
>
> #!/bin/bash
> until false
> do
>   planet.py geek/fancy/config.ini
>   sleep 900
> done
> exit 0
>
> --Adrian
> -
> 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
>


-- 
Jean Michel Bouchara
Completo Tecnologia Ltda. - http://www.completo.com.br/
Fone / Fax: (0xx11) 3081-3644
--
Visite o site http://www.escrevinhadora.com.br/


-
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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Emulate(?) the crontab
  2007-01-10 12:09 ` Adrian C.
@ 2007-01-10 12:43   ` Adam T. Bowen
  0 siblings, 0 replies; 10+ messages in thread
From: Adam T. Bowen @ 2007-01-10 12:43 UTC (permalink / raw)
  To: Adrian C.; +Cc: jean, linux-admin

Buy an interstellar-chameleon-monkey, send him back in time to 1970,
where he can impersonate Dennis Richie and insert some code into the C
compiler that will propagate down through time into the latest compilers
used to build Linux and add some code allowing you to edit the inittab file.

Oh, bugger.  I forgot. You can't buy interstellar-chameleon-monkeys yet.
 Sorry.  Scratch that idea.

Adam

Adrian C. wrote:
> I seriously doubt that would work as our guy here is not root, thus the
> question asked.
> 
> # ls -l /etc/inittab
> -rw-r--r--  1 root root 2464 2002-05-07 07:45 /etc/inittab 
> 
> 
> --Adrian
> 
> 
> 
> -----Original Message-----
> From: linux-admin-owner@vger.kernel.org
> [mailto:linux-admin-owner@vger.kernel.org] On Behalf Of Jean M. Bouchara
> Sent: Wednesday, January 10, 2007 13:16 PM
> To: linux-admin@vger.kernel.org
> Subject: Re: Emulate(?) the crontab
> 
> 
> Put the command in /etc/inittab:
> 
> 
> ap:3:respawn:/usr/local/bin/my_script.sh
> or
> ap:3:respawn:/bin/su - someuser -c /usr/local/bin/my_script.sh
> 
> 
> 
>> Hello,
> 
>> I guess you could run something like this in the background..
>>
>> #!/bin/bash
>> until false
>> do
>>   planet.py geek/fancy/config.ini
>>   sleep 900
>> done
>> exit 0
>>
>> --Adrian
>> -
>> 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
>>
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2007-01-10 12:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-10 11:16 Emulate(?) the crontab Jean M. Bouchara
2007-01-10 12:09 ` Adrian C.
2007-01-10 12:43   ` Adam T. Bowen
  -- strict thread matches above, loose matches on Subject: below --
2007-01-10 11:05 Adrian C.
2007-01-09 19:33 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
2007-01-10  0:27 ` terry white
2007-01-10  9:41 ` Adam T. Bowen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).