I added a cronjob via crontab -e which is to be executed every minute. I enabled and started cronie on systemctl.Set editor$ export EDITOR=vimAdd cront tasks$ crontab -e* * * * * Rscript /srv/shiny-system/cron/CPU.R~~/tmp/crontab.8VZ7vq 1 line, 47 characters Install cronie$ sudo pacman -Syu cronie$ sudo systemctl enable --now cronie.service$ systemctl status cronieList cron tasks$ crontab -l* * * * * Rscript /srv/shiny-system/cron/CPU.RI wrote this program below in R, when I start it in the shell it workes fine, but when i start it with cronie it just doesn't do what it is supposed to do.setwd(/srv/shiny-system/cron)I <- 0for (i in 1:60) {    system(top -n 1 -b -u shiny > top.log)    dat <- readLines(top.log)    id <- grep(R$, dat)    Names <- strsplit(gsub(^ +|%|\\+, , dat[7]),  +)[[1]]    if (length(id) > 0) {        # top data frame;        L <- strsplit(gsub(^ *, , dat[id]),  +)        dat <- data.frame(matrix(unlist(L), ncol = 12, byrow = T))        names(dat) <- Names        dat <- data.frame(Time = Sys.time(), dat[, -ncol(dat)], usr = NA, app = NA)        dat$CPU <-as.numeric(as.character(dat$CPU))        dat$MEM <-as.numeric(as.character(dat$MEM))        # Check if connection number changed;        for (i in 1:length(dat$PID)) {            PID <- dat$PID[i]            system(paste(sudo -i netstat -p | grep , PID,  > netstat.log))            # system(paste(sudo -i netstat -p | grep , PID,  >> netstat.log2))            system(paste(sudo -i lsof -p , PID,  | grep DIR > lsof.log))            netstat <- readLines(netstat.log)            lsof <- readLines(lsof.log)            dat$usr[i] <- length(grep(ESTABLISHED, netstat) & grep(tcp, netstat))            dat$app[i] <- regmatches(lsof, regexec(srv/shiny-server/(.*), lsof))[[1]][2]        }        dat <- dat[, c(app, usr)]    } else {        dat <- data.frame(app = app1, usr = 0)    }    write.table(dat, file = CPU.txt)}This program generates these 4 files below and cronie seems to be running bcos I can see them in this location /srv/shiny-system/cron,top.lognetstat.loglsof.logCPU.txtBut the problem is there is no log/ data/ info in netstat.log and lsof.logSo is this a problem in my R program or in cronie actually?But when I run this program with the cron in Ubuntu Linux, I get the data I am after in netstat.log and lsof.log.So is this a bug/ problem in Arch Linux?? It seems that Arch has a problem with netstat and lsof. I have netstat installed as well,Install net-tools for netstat$ sudo pacman -S net-tools Any ideas?
Arch Linux - Cronie is not working and nestat does not output logs?
arch linux;syslog;netstat;lsof;r