LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   crontab (https://www.linuxquestions.org/questions/linux-software-2/crontab-126936/)

ALF 12-18-2003 10:32 AM

crontab
 
Hi,

I edited crontab and tested it to make sure it is doing exactly what I want. Then I logged off.

The next day I found out that the crontab didn't run at night as it should, but after I logged on crontab started to work !

Do I need to keep my user logged on all the time to let crontab run, or am I missing something?

Alf

jkobrien 12-18-2003 10:38 AM

No, that's the whole point of crontab.

What is the crontab entry for your job?

John

ALF 12-18-2003 10:49 AM

crontab
 
it is very simple - just to get disk free info into a history file :


$ crontab -l

0 6-7 * * 1-5 echo ============== >> /home/alf/df_history.txt
0,30 8-18 * * 1-5 /home/alf/df_history


So, when I checked the file, it missed the two lines (in the echo ===== command) and the df_history script at 8 (as I logged on at about 8:05).

Alf

jkobrien 12-18-2003 11:05 AM

From this, I would expect to see two "===================" lines in df_history.txt (assuming the file was empty the previous evening).

You haven't redirected the output of df_history to the txt file. Is that coded in the script itself? Did you use an absolute pathname?

John

ALF 12-18-2003 11:10 AM

Yes, actually it is working now without any problem. (it dumps every 30 minutes output of df -k to the history file with date stamp).

I guess I'll try to log off now for while and see if it stopped during that period or not.

Alf


All times are GMT -5. The time now is 11:50 PM.