Discussion:
[RCU] Cron files
Jorge Bastos
2017-12-07 10:43:03 UTC
Permalink
Hi,



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



gc.sh



and what else?



Thanks,
Ulli Heist
2017-12-07 15:29:36 UTC
Permalink
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: users-***@lists.roundcube.net
[mailto:users-***@lists.roundcube.net] On Behalf Of Jorge Bastos
Sent: Thursday, December 07, 2017 11:43 AM
To: 'Roundcube Users mailing list' <***@lists.roundcube.net>
Subject: [RCU] Cron files



Hi,



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



gc.sh



and what else?



Thanks,
Thomas Bruederli
2017-12-10 14:55:56 UTC
Permalink
On Thu, Dec 7, 2017 at 4:29 PM, Ulli Heist
Post by Ulli Heist
Hello,
$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
Jorge Bastos
2017-12-11 10:04:26 UTC
Permalink
Hi Thomas,

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

-----Original Message-----
From: users-***@lists.roundcube.net
[mailto:users-***@lists.roundcube.net] On Behalf Of Thomas Bruederli
Sent: 10 de dezembro de 2017 14:56
To: Roundcube Users mailing list <***@lists.roundcube.net>
Subject: Re: [RCU] Cron files
Post by Ulli Heist
Hello,
$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
Jorge Bastos
2017-12-11 10:33:24 UTC
Permalink
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:***@thelounge.net]
Sent: 11 de dezembro de 2017 10:21
To: Roundcube Users mailing list <***@lists.roundcube.net>; Jorge Bastos
<***@decimal.pt>
Subject: Re: [RCU] Cron files
Post by 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
Post by Jorge Bastos
-----Original Message-----
Bruederli
Sent: 10 de dezembro de 2017 14:56
Subject: Re: [RCU] Cron files
On Thu, Dec 7, 2017 at 4:29 PM, Ulli Heist
Post by Ulli Heist
Hello,
$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
Loading...