I have some cron jobs that are making sure the VPN is being established. Everything works fine and I've been checking this from time to time. However, in the morning I noticed that the VPN is down and the cron jobs are not running.

I logged in via SSH checked the cron job logs that I've manually put, but no errors whatsoever and I the last time the log was filled was 20:00h.

-rwxr-xr-x 1 ema ema 17K okt 10 20:00 dnsjob.log
-rw-rw-r-- 1 ema ema 17K okt 10 20:00 new_output.log
-rwxr-xr-x 1 ema ema 17K okt 10 20:00 vpnjob.log

I also checked if the cron daemon is up and everything seems to be in order.

Somehow, the cronjobs are running after a while and I have no idea why.

Is there any possibility to check what's going on? Is there any kind of "sleep mode" where cron jobs are just paused for no specific reason?

One of the cronjobs (dns update script) is as following:

*/9 * * * * sudo /usr/sbin/ddclient -force 2>&1 >> /home/ema/scripts/crons/dnsjob.log

But everything looks fine inside dnsjob.log and the last input is from 17 October at 20:00..

It seems that when I'm connected to the system via SSH, the crontab works, but once I'm disconnected, it works for a while and finally stops executing anything. I've been trying to find some relevant information in the manuals and logs, but no luck.

  • encrypted home directory you are writing to? – Jakuje Oct 17 '16 at 14:10
  • Yes... Really good find, I wouldn't have thought of that. Is there a difference? – Sasho Andrijeski Oct 18 '16 at 7:29

You are using encrypted home directory. When you log out of the server (close ssh session), the home directory is encrypted and therefore you can't write to files inside. It is a feature (and point of encrypting homes).

  • Thanks a lot! I moved the scripts to another directory and they are working non-stop now. – Sasho Andrijeski Oct 19 '16 at 6:29

Add write permission for other user to your log file. Then try.

sudo chmod 666 /home/ema/scripts/crons/dnsjob.log

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.