Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Immortality consists largely of boredom. -- Zefrem Cochrane, "Metamorphosis", stardate 3219.8


computers / rocksolid.shared.helpdesk / Re: Problem with cronjob

SubjectAuthor
* Problem with cronjobGuest
`* Problem with cronjobRetro Guy
 `* Problem with cronjobGuest
  `* Problem with cronjobRetro Guy
   `* Problem with cronjobGuest
    `- Problem with cronjobRetro Guy

1
Problem with cronjob

<r72hb3$88r$1@i2pn2.org>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=79&group=rocksolid.shared.helpdesk#79

 copy link   Newsgroups: rocksolid.shared.helpdesk
Path: i2pn2.org!.POSTED!not-for-mail
From: gue...@retrobbs.rocksolidbbs.com (Guest)
Newsgroups: rocksolid.shared.helpdesk
Subject: Problem with cronjob
Date: Mon, 13 Apr 2020 16:18:04 -0400
Organization: Dancing elephants
Lines: 9
Message-ID: <r72hb3$88r$1@i2pn2.org>
Reply-To: Guest <guest@retrobbs.rocksolidbbs.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 13 Apr 2020 20:16:36 -0000 (UTC)
Injection-Info: i2pn2.org; posting-account="def.i2p";
logging-data="8475"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: FUDforum 3.0.7
X-FUDforum: 6666cd76f96956469e7be39d750cc7d9 <102041>
 by: Guest - Mon, 13 Apr 2020 20:18 UTC

I have a cronjob under /etc/cron.d/test on a Debain Stretch system, which is supposed to launch a php script with the rights of the webserver.
This is the content:

*/5 * * * * /bin/su - www-data -s /bin/bash -c '/usr/bin/php /var/www/php/test.php'

So this is supposed to run every 5 minutes. The line itself on the cli does exactly what it should (so:
/bin/su - www-data -s /bin/bash -c '/usr/bin/php /var/spool/news/diym/diym/php/test.php'
starts the script like it should). All the files are in place and accessible for the webserver.

But the cronjob does exactly nothing. wtf ? what do i miss ?
Posted on def3

Re: Problem with cronjob

<8eb7e200f396ae978dd6b48fb99e456a$1@news.novabbs.com>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=80&group=rocksolid.shared.helpdesk#80

 copy link   Newsgroups: rocksolid.shared.helpdesk
Path: i2pn2.org!.POSTED!not-for-mail
From: Retro ...@rslight.i2p (Retro Guy)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: Problem with cronjob
Date: Tue, 14 Apr 2020 00:08:01 -0000 (UTC)
Organization: Rocksolid Light
Message-ID: <8eb7e200f396ae978dd6b48fb99e456a$1@news.novabbs.com>
References: <r72hb3$88r$1@i2pn2.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 14 Apr 2020 00:08:01 -0000 (UTC)
Injection-Info: i2pn2.org; posting-account="retrobbs1";
logging-data="6414"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs.com
X-Rslight-Site: $2y$10$CzkctrC03Cw3nS7PjM.WvuT2ATEx6G4ZijbkBtgcFHgv4Nybv49kW
 by: Retro Guy - Tue, 14 Apr 2020 00:08 UTC

Guest wrote:

> I have a cronjob under /etc/cron.d/test on a Debain Stretch system, which is supposed to launch a php script with the rights of the webserver.
> This is the content:

> */5 * * * * /bin/su - www-data -s /bin/bash -c '/usr/bin/php /var/www/php/test.php'

> So this is supposed to run every 5 minutes. The line itself on the cli does exactly what it should (so:
> /bin/su - www-data -s /bin/bash -c '/usr/bin/php /var/spool/news/diym/diym/php/test.php'
> starts the script like it should). All the files are in place and accessible for the webserver.

> But the cronjob does exactly nothing. wtf ? what do i miss ?
> Posted on def3

You might try '-l' to bash to "Make bash act as if it had been invoked as a login shell", so:

*/5 * * * * /bin/su - www-data -s /bin/bash -lc '/usr/bin/php /var/www/php/test.php'

This should provide the same environment as running from the command line.

Retro Guy

--
Posted on: Rocksolid Light
news.novabbs.com

Re: Problem with cronjob

<r73o2g$oju$1@i2pn2.org>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=81&group=rocksolid.shared.helpdesk#81

 copy link   Newsgroups: rocksolid.shared.helpdesk
Path: i2pn2.org!.POSTED!not-for-mail
From: gue...@retrobbs.rocksolidbbs.com (Guest)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: Problem with cronjob
Date: Tue, 14 Apr 2020 03:19:07 -0400
Organization: Dancing elephants
Lines: 1
Message-ID: <r73o2g$oju$1@i2pn2.org>
References: <8eb7e200f396ae978dd6b48fb99e456a$1@news.novabbs.com>
Reply-To: Guest <guest@retrobbs.rocksolidbbs.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 14 Apr 2020 07:17:37 -0000 (UTC)
Injection-Info: i2pn2.org; posting-account="def.i2p";
logging-data="25214"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: FUDforum 3.0.7
X-FUDforum: 6666cd76f96956469e7be39d750cc7d9 <102048>
 by: Guest - Tue, 14 Apr 2020 07:19 UTC

I tried with -lc, but the same result: nothing.
Thanks anyway.
Posted on def3

Re: Problem with cronjob

<84a557c77d4042b9002723fa6ba464a6$1@news.novabbs.com>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=82&group=rocksolid.shared.helpdesk#82

 copy link   Newsgroups: rocksolid.shared.helpdesk
Path: i2pn2.org!.POSTED!not-for-mail
From: Retro ...@rslight.i2p (Retro Guy)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: Problem with cronjob
Date: Tue, 14 Apr 2020 07:55:02 -0000 (UTC)
Organization: Rocksolid Light
Message-ID: <84a557c77d4042b9002723fa6ba464a6$1@news.novabbs.com>
References: <8eb7e200f396ae978dd6b48fb99e456a$1@news.novabbs.com> <r73o2g$oju$1@i2pn2.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 14 Apr 2020 07:55:02 -0000 (UTC)
Injection-Info: i2pn2.org; posting-account="retrobbs1";
logging-data="30298"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs.com
X-Rslight-Site: $2y$10$ZcB26h.ixNsI7vsS2X1zn.Wk4yp1j9mJnfcgSYdNMrSPeG0VZNpOG
 by: Retro Guy - Tue, 14 Apr 2020 07:55 UTC

A few other ideas:

I'm sure you thought of this, but are you running it in the crontab for root?

Does the script need to be run from it's current directory? If so, it won't work unless you change to that directory.

When you say it does 'nothing', have you checked to see if the script is executed, even though it does not perform it's tasks? It's two different problems if it either never executes the script at all, or if the script fails to perform.

Can you post the script so others can test?

Retro Guy

--
Posted on: Rocksolid Light
news.novabbs.com

Re: Problem with cronjob

<r748ct$vbe$1@i2pn2.org>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=83&group=rocksolid.shared.helpdesk#83

 copy link   Newsgroups: rocksolid.shared.helpdesk
Path: i2pn2.org!.POSTED!not-for-mail
From: gue...@retrobbs.rocksolidbbs.com (Guest)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: Problem with cronjob
Date: Tue, 14 Apr 2020 07:57:44 -0400
Organization: Dancing elephants
Lines: 1
Message-ID: <r748ct$vbe$1@i2pn2.org>
References: <84a557c77d4042b9002723fa6ba464a6$1@news.novabbs.com>
Reply-To: Guest <guest@retrobbs.rocksolidbbs.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 14 Apr 2020 11:56:15 -0000 (UTC)
Injection-Info: i2pn2.org; posting-account="def.i2p";
logging-data="32110"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: FUDforum 3.0.7
X-FUDforum: 6666cd76f96956469e7be39d750cc7d9 <102050>
 by: Guest - Tue, 14 Apr 2020 11:57 UTC

ok, it it is solved. i edited directly instead of using crontab -e, and was introducing formal errors in the file, which made cron disregard it.
thanks.
Posted on def3

Re: Problem with cronjob

<46abfb50db9a90d6972060a070b0369a$1@news.novabbs.com>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=84&group=rocksolid.shared.helpdesk#84

 copy link   Newsgroups: rocksolid.shared.helpdesk
Path: i2pn2.org!.POSTED!not-for-mail
From: Retro ...@rslight.i2p (Retro Guy)
Newsgroups: rocksolid.shared.helpdesk
Subject: Re: Problem with cronjob
Date: Tue, 14 Apr 2020 23:16:01 -0000 (UTC)
Organization: Rocksolid Light
Message-ID: <46abfb50db9a90d6972060a070b0369a$1@news.novabbs.com>
References: <84a557c77d4042b9002723fa6ba464a6$1@news.novabbs.com> <r748ct$vbe$1@i2pn2.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 14 Apr 2020 23:16:01 -0000 (UTC)
Injection-Info: i2pn2.org; posting-account="retrobbs1";
logging-data="3230"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: Rocksolid Light (news.novabbs.com/getrslight)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs.com
X-Rslight-Site: $2y$10$2khGE45C9LFFh0CnfWiquuSE8t/E3avSoGiAMfhz9SsaswU7wsV5O
 by: Retro Guy - Tue, 14 Apr 2020 23:16 UTC

Guest wrote:

> ok, it it is solved. i edited directly instead of using crontab -e, and was introducing formal errors in the file, which made cron disregard it.
> thanks.
> Posted on def3

Nice! Glad you got it working, and thanks for posting the solution.

--
Posted on: Rocksolid Light
news.novabbs.com

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor