cronnitrousio

How can one check cron.log on Nitrous.io?


We are attempting to implement a cron job, on Nitrous.io. However, cron is not working.

Entry is present in the crontab. However we are unable to check cron.log and to find cron.log

What is a way to check cron.log, using Nitrous.io?

and

Is there any service to start and stop cron on nitrous?


Solution

  • Cron by default logs to syslog, which is not accessible for Nitrous.IO users. You will want to log the command output to a custom file instead.

    Here is a quick example of how to log a ping request on a Nitrous.IO box:

    Navigate to the workspace folder and create a new log file called cron.log:

    $ cd ~/workspace
    
    $ touch cron.log
    

    Edit your crontab to run the ping command every minute:

    $ crontab -e
    

    This will open up Vim. Add the following into line 1 and save the file:

    * * * * * /bin/ping -c 1 192.168.0.1 > /home/action/workspace/cron.log
    

    Check the contents after a minute to see if the log has been populated.

    $ cat ~/workspace/cron.log