Incase anyone else needs it, here's the solution.
QString jobList
= "* * * * * /command\n";
// Don't forget \n.
cronProcess.waitForStarted();
cronProcess.closeWriteChannel();
cronProcess.waitForFinished();
QProcess cronProcess;
QString jobList = "* * * * * /command\n"; // Don't forget \n.
cronProcess.start("crontab", QStringList() << "-");
cronProcess.waitForStarted();
cronProcess.write(QByteArray(jobList.toAscii()));
cronProcess.closeWriteChannel();
cronProcess.waitForFinished();
To copy to clipboard, switch view to plain text mode
Bookmarks