Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have located a script in /bin/filename and i want to check it in contab if it's running every 2 min. How should my contab look like?

# m h dom mon dow user  command
17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
0 2 * * * * root /bin/filename
# 

Is it ok? thanks

share|improve this question
add comment

2 Answers 2

Edit: Misunderstood question. */2 for a job every 2 minutes. Then use below to see if its running

You can do something like this:
cat /var/log/syslog | grep cron
to see just the cron entries in the system log.


Or open up /etc/rsyslog.conf and uncomment the line that looks like this
cron.* /var/log/cron.log
That will create a file in /var/log which you can monitor with tail:
tail -f /var/log/cron.log

share|improve this answer
add comment
*/2 *  * * *  root  /bin/filename
share|improve this answer
    
(Missing newline bef ore EOF, this crontab file will be ignored) ?? –  erss Apr 16 '13 at 13:04
    
I think you should put a new line (press Enter) after the last line. –  Eric Carvalho Apr 16 '13 at 13:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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