I have an Ubuntu 14.04.5 installed and I'm trying to run a cron but it does not work.
$ whoami root $ crontab -e #append at the end of the file * * * * * env > /tmp/env_root.output #save and quit :wq $ less /var/log/cron.log ...... Sep 22 20:15:01 myserver CRON: (root) CMD (env > /tmp/env_root.output) $ ls -la /tmp/env_root.output ls: cannot access /tmp/env_root.output: No such file or directory
Why is this? I am root and I should be able to edit files, the Cron log shows it as being changed, but no file is there. If I run the command in the current GNU BASH shell or even in /bin/sh it works but not in Cron.
What am I doing wrong? Does Ubuntu have something like SELinux that I might have enabled by mistake? I provision my server with Ansible and I am not the only person working on the Ansible roles.
EDIT: This is how my /etc/crontab looks and it runs /usr/bin/myscript.sh https://paste.fedoraproject.org/433591/74650461/