-1

I have a list of cronjob set to run in a regular schedule. After read and tried this suggestion here:

https://stackoverflow.com/a/22744360/1478789

I still haven't able to figure it out why my cron job is not running.

Result: ps ax | grep cron

When I tried with this simple command:

* * * * * /bin/echo "cron works" >> /home/user/somefile.log

It does not append any text to the intended file.

So, I try to do it "manually" by executing the following command:

user@machine:~$ echo "Random text" >> /home/user/somefile.log

It appends some text to the file.

Lastly, when I issue the following command:

user@machine:~$ grep CRON /var/log/syslog

It doesn't print anything at all

By the way, I edit my cron

user@machine:~$ sudo EDITOR=nano crontab -e

if, I use this:

user@machine:~$ EDITOR=nano crontab -e (without sudo)

I get the following message:

no crontab for user - using an empty one
Error reading /home/user/.nano_history: permission denied
Press Enter to continue starting nano

Can anyone help my to troubleshoot this, thanks.

Community
  • 1
  • 1
Jeremy
  • 2,516
  • 8
  • 46
  • 80
  • You should not be touching `sudo`, it is very easy to mess up permissions in your home directory, this is likely the cause of the error about `~/.nano_history`. – o11c Jun 15 '15 at 06:29
  • @o11c Thanks for the advice, let me check on that first. – Jeremy Jun 15 '15 at 06:44
  • http://askubuntu.com/ is maybe a better place for this kind of questions. – mana Jun 15 '15 at 08:58
  • This question appears to be [off topic](http://stackoverflow.com/help/on-topic). – Jørgen R Jun 15 '15 at 11:54
  • @o11c Thanks for your hint. You are right, there is something wrong with .nano_history file. – Jeremy Jun 16 '15 at 15:55

1 Answers1

0

is cron running?

$ps ax | grep cron
1236 ?        Ss     0:00 cron

if not check,

$ sudo /etc/init.d/cron.status
cron start/running, process 1236

if yours isnt running it'll say something like: cron stop/waiting

try starting it with

$sudo /etc/init.d/cron start

-- hth

keith

EDIT: My bad i see your cron is running after re-reading your post ... hmmm will look into this further as i remember having a similar problem a few months ago i also am running ubuntu 14.04 on my laptop. Sorry...

mana
  • 6,347
  • 6
  • 50
  • 70