rsync: check if source directories in customer repositories exist.

This commit is contained in:
Gerhard Hoffmann 2023-10-06 13:00:25 +02:00
parent 145fdab26e
commit 09d5de1b0b

View File

@ -887,8 +887,15 @@ bool Worker::syncCustomerRepositoryAndFS() {
"--include=*.json "
"--include=*.ini");
QStringList cmds;
cmds << QString("rsync ") + params.simplified() + " etc/ /etc";
cmds << QString("rsync ") + params.simplified() + " opt/ /opt";
if (QDir(QDir::cleanPath(m_customerRepository + QDir::separator() + "etc/")).exists()) {
cmds << QString("rsync ") + params.simplified() + " etc/ /etc";
Utils::printInfoMsg(QString("CONFIGURED SYNCING TO /ETC"));
}
if (QDir(QDir::cleanPath(m_customerRepository + QDir::separator() + "opt/")).exists()) {
cmds << QString("rsync ") + params.simplified() + " opt/ /opt";
Utils::printInfoMsg(QString("CONFIGURED SYNCING TO /OPT"));
}
QString cmd;
bool error = false;