0

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

2 Answers 2

1

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

0
*/2 *  * * *  root  /bin/filename
2
  • (Missing newline bef ore EOF, this crontab file will be ignored) ??
    – erss
    Apr 16, 2013 at 13:04
  • I think you should put a new line (press Enter) after the last line. Apr 16, 2013 at 13:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .