mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-26 15:20:29 +01:00
2018-08-13 Fred Gleason <fredg@paravelsystems.com>
* Removed support for the 'Backup Database' ['DB'] RML. * Removed support for automatic DB backup. * Dropped the 'STATIONS.BACKUP_DIR' and 'STATIONS.BACKUP_LIFE' fields drom the database. * Incremented the database version to 296.
This commit is contained in:
@@ -271,29 +271,6 @@ void MainObject::RunLocalMacros(RDMacro *rml_in)
|
||||
return;
|
||||
break;
|
||||
|
||||
case RDMacro::DB:
|
||||
if(rml->argQuantity()!=1) {
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(false);
|
||||
sendRml(rml);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if(fork()==0) {
|
||||
cmd=QString().sprintf("mysqldump -c Rivendell -h %s -u %s -p%s > %s",
|
||||
(const char *)rda->config()->mysqlHostname(),
|
||||
(const char *)rda->config()->mysqlUsername(),
|
||||
(const char *)rda->config()->mysqlPassword(),
|
||||
(const char *)rml->arg(0));
|
||||
system((const char *)cmd);
|
||||
exit(0);
|
||||
}
|
||||
if(rml->echoRequested()) {
|
||||
rml->acknowledge(true);
|
||||
sendRml(rml);
|
||||
}
|
||||
break;
|
||||
|
||||
case RDMacro::GI:
|
||||
if(rml->argQuantity()!=5) {
|
||||
if(rml->echoRequested()) {
|
||||
|
||||
@@ -172,14 +172,6 @@ MainObject::MainObject(QObject *parent)
|
||||
ripcd_notification_mcaster->bind(RD_NOTIFICATION_PORT);
|
||||
ripcd_notification_mcaster->subscribe(rda->system()->notificationAddress());
|
||||
|
||||
//
|
||||
// Database Backup Timer
|
||||
//
|
||||
databaseBackup();
|
||||
ripcd_backup_timer=new QTimer(this);
|
||||
connect(ripcd_backup_timer,SIGNAL(timeout()),this,SLOT(databaseBackup()));
|
||||
ripcd_backup_timer->start(86400000);
|
||||
|
||||
//
|
||||
// Exit Timer
|
||||
//
|
||||
@@ -293,33 +285,6 @@ void MainObject::rmlReplyData()
|
||||
}
|
||||
|
||||
|
||||
void MainObject::databaseBackup()
|
||||
{
|
||||
QString cmd;
|
||||
QDateTime datetime=QDateTime::currentDateTime();
|
||||
int life;
|
||||
|
||||
if((life=rda->station()->backupLife())<=0) {
|
||||
return;
|
||||
}
|
||||
if(fork()==0) {
|
||||
cmd=QString().sprintf("find %s -name *.sql -ctime +%d -exec rm \\{\\} \\;",
|
||||
(const char *)rda->station()->backupPath(),
|
||||
rda->station()->backupLife());
|
||||
system((const char *)cmd);
|
||||
cmd=QString().
|
||||
sprintf("mysqldump -c Rivendell -h %s -u %s -p%s > %s/%s.sql",
|
||||
(const char *)rda->config()->mysqlHostname(),
|
||||
(const char *)rda->config()->mysqlUsername(),
|
||||
(const char *)rda->config()->mysqlPassword(),
|
||||
(const char *)rda->station()->backupPath(),
|
||||
(const char *)datetime.date().toString("yyyyMMdd"));
|
||||
system((const char *)cmd);
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MainObject::readyReadData(int conn_id)
|
||||
{
|
||||
char data[1501];
|
||||
|
||||
@@ -74,7 +74,6 @@ class MainObject : public QObject
|
||||
void gpoStateData(int matrix,unsigned line,bool state);
|
||||
void ttyTrapData(int cartnum);
|
||||
void ttyScanData();
|
||||
void databaseBackup();
|
||||
void macroTimerData(int num);
|
||||
void readyReadData(int conn_id);
|
||||
void killData(int conn_id);
|
||||
@@ -125,7 +124,6 @@ class MainObject : public QObject
|
||||
RDTTYDevice *ripcd_tty_dev[MAX_TTYS];
|
||||
RDTty::Termination ripcd_tty_term[MAX_TTYS];
|
||||
RDCodeTrap *ripcd_tty_trap[MAX_TTYS];
|
||||
QTimer *ripcd_backup_timer;
|
||||
bool ripc_onair_flag;
|
||||
QTimer *ripc_macro_timer[RD_MAX_MACRO_TIMERS];
|
||||
unsigned ripc_macro_cart[RD_MAX_MACRO_TIMERS];
|
||||
|
||||
Reference in New Issue
Block a user