mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 23:32:54 +09:00
Move all CLI scripts except common.cron to the "scripts" directory under the corresponding module
This commit is contained in:
parent
792ea89e64
commit
9ca2f79dce
14 changed files with 490 additions and 394 deletions
|
|
@ -1,66 +1,8 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* This script deletes old logs from the database.
|
||||
*
|
||||
* Rhymix produces various logs that can increase the size of the database
|
||||
* unnecessarily if not cleaned. This script removes old logs.
|
||||
* This script is @deprecated.
|
||||
* Please invoke: php index.php module.cleanMiscLogs
|
||||
*/
|
||||
require_once __DIR__ . '/common.php';
|
||||
|
||||
// Delete logs older than this number of days.
|
||||
$days = 30;
|
||||
|
||||
// Initialize the exit status.
|
||||
$exit_status = 0;
|
||||
|
||||
// Delete advanced mailer mail logs.
|
||||
$args = new stdClass;
|
||||
$args->regdate = date('YmdHis', time() - ($days * 86400));
|
||||
$output = executeQuery('advanced_mailer.deleteMailLogs', $args);
|
||||
if ($output->toBool())
|
||||
{
|
||||
echo "Successfully deleted all mail logs older than $days days.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Error while deleting mail logs older than $days days.\n";
|
||||
echo $output->getMessage() . "\n";
|
||||
$exit_status = 11;
|
||||
}
|
||||
|
||||
// Delete advanced mailer SMS logs.
|
||||
$args = new stdClass;
|
||||
$args->regdate = date('YmdHis', time() - ($days * 86400));
|
||||
$output = executeQuery('advanced_mailer.deleteSMSLogs', $args);
|
||||
if ($output->toBool())
|
||||
{
|
||||
echo "Successfully deleted all SMS logs older than $days days.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Error while deleting SMS logs older than $days days.\n";
|
||||
echo $output->getMessage() . "\n";
|
||||
$exit_status = 12;
|
||||
}
|
||||
|
||||
// Delete spamfilter logs.
|
||||
$args = new stdClass;
|
||||
$args->regdate = date('YmdHis', time() - ($days * 86400));
|
||||
$output = executeQuery('spamfilter.deleteLog', $args);
|
||||
if ($output->toBool())
|
||||
{
|
||||
echo "Successfully deleted all spamfilter logs older than $days days.\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Error while deleting spamfilter logs older than $days days.\n";
|
||||
echo $output->getMessage() . "\n";
|
||||
$exit_status = 12;
|
||||
}
|
||||
|
||||
// Set the exit status if there were any errors.
|
||||
if ($exit_status != 0)
|
||||
{
|
||||
exit($exit_status);
|
||||
}
|
||||
require_once RX_BASEDIR . 'modules/module/scripts/cleanMiscLogs.php';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue