Cron files

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Cron files

Jorge Bastos

Hi,

 

Which cron job’s should be added for a good maintenance of RC?

 

gc.sh

 

and what else?

 

Thanks,


_______________________________________________
Roundcube Users mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Cron files

Ulli Heist-2

Hello,

 

sometimes I’m doing manuel:

 

$SQL = "SELECT * FROM `contacts` WHERE `del` = 1 AND DATE_ADD(`changed`,INTERVAL 45 DAY) < NOW() ";

$res = mysql_query($SQL) or die (__LINE__ .": ".$SQL);

 

while($row = mysql_fetch_array($res))

{

$SQL = "DELETE FROM `contactgroupmembers` WHERE `contact_id` = ".$row['contact_id'];

$rex = mysql_query($SQL) or die (__LINE__ .": ".$SQL);

 

$SQL = "DELETE FROM `contacts` WHERE `contact_id` = ".$row['contact_id'];

$rex = mysql_query($SQL) or die (__LINE__ .": ".$SQL);

 

echo "Delete ".$row['contact_id']."<br>";

flush();

}

mysql_free_result($res);

 

Best regards from germany

 

Ulli

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Jorge Bastos
Sent: Thursday, December 07, 2017 11:43 AM
To: 'Roundcube Users mailing list' <[hidden email]>
Subject: [RCU] Cron files

 

Hi,

 

Which cron job’s should be added for a good maintenance of RC?

 

gc.sh

 

and what else?

 

Thanks,


_______________________________________________
Roundcube Users mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Cron files

Thomas Bruederli-2
On Thu, Dec 7, 2017 at 4:29 PM, Ulli Heist
<[hidden email]> wrote:
> Hello,
>
> sometimes I’m doing manuel:
>
> $SQL = "SELECT * FROM `contacts` WHERE `del` = 1 AND
> DATE_ADD(`changed`,INTERVAL 45 DAY) < NOW() ";
>
> ...

We have `bin/cleandb.sh` in Roundcube that does exactly this ;-)

This and the already mentioned `bin/gc.sh` should do it for periodic clean-ups.

~Thomas
_______________________________________________
Roundcube Users mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Cron files

Jorge Bastos
Hi Thomas,

Thank you, so i'll add gc and cleandb, whould this be running daily?

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Thomas Bruederli
Sent: 10 de dezembro de 2017 14:56
To: Roundcube Users mailing list <[hidden email]>
Subject: Re: [RCU] Cron files

On Thu, Dec 7, 2017 at 4:29 PM, Ulli Heist <[hidden email]>
wrote:
> Hello,
>
> sometimes I'm doing manuel:
>
> $SQL = "SELECT * FROM `contacts` WHERE `del` = 1 AND
> DATE_ADD(`changed`,INTERVAL 45 DAY) < NOW() ";
>
> ...

We have `bin/cleandb.sh` in Roundcube that does exactly this ;-)

This and the already mentioned `bin/gc.sh` should do it for periodic
clean-ups.

~Thomas
_______________________________________________
Roundcube Users mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/users
_______________________________________________
Roundcube Users mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Cron files

Jorge Bastos
Thank you,

That's what I had in mind.
Daly would be fine for me have a few thousands but nothing the machine
cannot handle, machines are meant to work :p

Thank you all for the tips,

-----Original Message-----
From: Reindl Harald [mailto:[hidden email]]
Sent: 11 de dezembro de 2017 10:21
To: Roundcube Users mailing list <[hidden email]>; Jorge Bastos
<[hidden email]>
Subject: Re: [RCU] Cron files



Am 11.12.2017 um 11:04 schrieb Jorge Bastos:
> Hi Thomas,
>
> Thank you, so i'll add gc and cleandb, whould this be running daily?

surely

if it would be destructive once per week bould be the same problem as per
day and if a simple cleanup job onece per day is a performance problem you
have bigger ones

> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Thomas
> Bruederli
> Sent: 10 de dezembro de 2017 14:56
> To: Roundcube Users mailing list <[hidden email]>
> Subject: Re: [RCU] Cron files
>
> On Thu, Dec 7, 2017 at 4:29 PM, Ulli Heist
> <[hidden email]>
> wrote:
>> Hello,
>>
>> sometimes I'm doing manuel:
>>
>> $SQL = "SELECT * FROM `contacts` WHERE `del` = 1 AND
>> DATE_ADD(`changed`,INTERVAL 45 DAY) < NOW() ";
>>
>> ...
>
> We have `bin/cleandb.sh` in Roundcube that does exactly this ;-)
>
> This and the already mentioned `bin/gc.sh` should do it for periodic
> clean-ups

_______________________________________________
Roundcube Users mailing list
[hidden email]
http://lists.roundcube.net/mailman/listinfo/users