Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a strange thing (i think), I added a line in my crontab on an QNAP NAS with crontab -e i saved (:wq!)

This line would have had a script to run for every 5 minutes so i dit 5 * * * * and the script name. And restarted the crontab.

This script fills a database. Last night i quit trying, went to bed and kept de NAS running. And wen ik woke up this morning i looked at the database and the script is running.

However it runs every hour, so i tought i take a look at the crontab, with crontab -l But i cant find the line with the script name in it ?

Can somebody explain this to me ?

May be the crontab is overwritten, but not restarted ??? (may be)(dont know).

share|improve this question

4 Answers 4

up vote 0 down vote accepted

editing crontab directly should work until QNAP reboots. You will loose your amendments. this explains why you can't find your job (pending QNAP rebooted. There seems to be some questions behind QNAP's cron anyway). you'll need to use autorun.sh which will allow you to load your specific configs on startup.

more reading on QNAP cron more reading on autorun.sh

share|improve this answer
    
actually, i should say that you could loose your amendments. again, QNAP cron doesn't seem very stable to me (IMHO). –  austin Aug 16 '12 at 13:06

Check /var/log/messages to see what is going on. Specifically, Check whether crond service is restarted after you lastest config (last night) or not.

share|improve this answer
    
This file is empy. So i have to find a way to start the logging. –  Plumbum7 Aug 16 '12 at 9:34

Also check /var/log/cron and /var/spool/cron/ for more information about running tasks.

share|improve this answer

You should check /var/spool/cron/ for active cron jobs. It is running every hour because you specified 5 * * * * not */5 * * * *.

share|improve this answer

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.