I had many cron jobs working perfectly before upgrade from Ubuntu 16.04 to 18.04. After the upgrade I can run all the defined jobs (using crontab -e) either in terminal or by clicking "Run Selected Task" in GUI "Configure Scheduled Tasks" but all these jobs are not being executed at scheduled (or any other) times... To say once again, I can perfectly without any problem execute all the defined jobs (call to R scripts) using terminal or mentioned GUI.
Output of cat /var/log/syslog | grep cron
:
Jul 25 16:16:41 usernameVB crontab[10530]: (username) LIST (username)
Jul 25 16:16:50 usernameVB crontab[10535]: (username) LIST (username)
Jul 25 16:16:59 usernameVB crontab[10545]: (username) LIST (username)
Jul 25 16:17:01 usernameVB CRON[10549]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Jul 25 16:17:08 usernameVB crontab[10553]: (username) LIST (username)
... (more of the LIST lines)
How to make cron jobs run at defined times?
EDIT: Added output of sudo systemctl status cron.service:
$sudo systemctl status cron.service
[sudo] password for username:
● cron.service - Regular background program processing daemon
Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: ena
Active: active (running) since Mon 2018-07-23 02:42:23 EDT; 2 days ago
Docs: man:cron(8)
Main PID: 734 (cron)
Tasks: 1 (limit: 4915)
CGroup: /system.slice/cron.service
└─734 /usr/sbin/cron -f
Jul 24 10:17:01 usernameVB CRON[30421]: pam_unix(cron:session): session opene
Jul 24 10:17:01 usernameVB CRON[30422]: (root) CMD ( cd / && run-parts --re
Jul 24 10:17:01 usernameVB CRON[30421]: pam_unix(cron:session): session close
Jul 25 02:17:01 usernameVB CRON[17013]: pam_unix(cron:session): session opene
Jul 25 02:17:01 usernameVB CRON[17013]: pam_unix(cron:session): session close
Jul 25 13:17:01 usernameVB CRON[3767]: pam_unix(cron:session): session opened
Jul 25 13:17:01 usernameVB CRON[3768]: (root) CMD ( cd / && run-parts --rep
Jul 25 13:17:01 usernameVB CRON[3767]: pam_unix(cron:session): session closed
Jul 25 16:17:01 usernameVB CRON[10548]: pam_unix(cron:session): session opene
Jul 25 16:17:01 usernameVB CRON[10548]: pam_unix(cron:session): session close
lines 1-19/19 (END)
EDIT 2:
I created jobs using command $crontab -e
which opens /tmp/crontab.Rnzw6Y/crontab
. The contents looks like this (several of those jut calling R scripts at different times/days).
45 15 * * 1-5 /usr/bin/R --vanilla --quiet < /home/username/code/scripts/R_script_1.R 2>&1 | tee -a "/home/username/log/R_script_1.R - `date +\%Y-\%m-\%d\ \%H:\%M:\%S`.log.txt" # JOB_ID_26
Let me point out that running this in terminal works just fine:
/usr/bin/R --vanilla --quiet < /home/username/code/scripts/R_script_1.R 2>&1 | tee -a "/home/username/log/R_script_1.R - `date +\%Y-\%m-\%d\ \%H:\%M:\%S`.log.txt"
All this worked perfectly fine until upgrade from 16.04 to 18.04.
First, I ran the command on Ubuntu.
In the second step I did this: