You've already forked crontab-ui
mirror of
https://github.com/alseambusher/crontab-ui.git
synced 2025-12-15 11:43:58 +08:00
Using the /etc/crontabs/root file
This commit is contained in:
@@ -115,8 +115,12 @@ exports.set_crontab = function(env_vars, callback){
|
||||
|
||||
fs.writeFile(exports.env_file, env_vars, function(err) {
|
||||
if (err) callback(err);
|
||||
|
||||
fs.writeFile(path.join(cronPath, "crontab"), crontab_string, function(err) {
|
||||
// In docker we're running as the root user, so we need to write the file as root and not crontab
|
||||
var fileName = "crontab"
|
||||
if(process.env.CRON_IN_DOCKER !== undefined) {
|
||||
fileName = "root"
|
||||
}
|
||||
fs.writeFile(path.join(cronPath, fileName), crontab_string, function(err) {
|
||||
if (err) return callback(err);
|
||||
/// In docker we're running crond using busybox implementation of crond
|
||||
/// It is launched as part of the container startup process, so no need to run it again
|
||||
|
||||
Reference in New Issue
Block a user