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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user