SOLUTION (code only):
yields:
I have learned that cron has a very small path statement, and that's it's best to use fully specified paths.
Now - what'a that "mailbox" referred to
----- (earlier posting -----
I'm new to both Task Scheduler and Bash, and I'm somehow getting things wrong.
What I want to do is have a script executed by cron twice a week to check for updates to my installed Ruby Version Manager. Here's my rvm-update.sh script -
In the KDE Task Scheduler (obtained by installing the kde-config-cron package), I ask it to execute command /home/tomc/rvm-update.sh. The script was supposed to run at noon today, and it appears to have done just that. Using KSystemLog to look at the system log (I've never done ANY of this before, and it's rather fun!) I see these entries (in the midst of many others) which I interpret to mean that cron did its job:
When I tested the script by asking Task Scheduler to run it manually, the script did exactly what it was supposed to: a terminal opened, and my first "echo" appeared, then output indicating a download from the rvm repository, then my second "echo" line appeared, and I was invited to press Enter to close things out. Checking my rvm-update-log.txt log file, I see the several pages of output which the rvm update always outputs.
But the noon cron run didn't do any of this - no terminal screen, and my run log file, which had content, from last night's test runs, was wholly empty. I ran it manually again this afternoon, and it all worked. I set it to run every minutes via cron, and it does exactly what the noon run did - no log output, and now it's generating log errors (which I don't understand, and Google's not helping me, yet...):
Can anyone offer me any suggestions as to what's happening and how I can fix it? (and what's that mailbox referred to and how can I get to it)
Code:
/home/tomc/.rvm/bin/rvm get latest > /home/tomc/rvm-update-log.txt /home/tomc/.rvm/bin/rvm reload exit
Code:
05/01/11 04:30:01 PM LDT CRON[10898] (tomc) CMD (/home/tomc/rvm-update.sh) 05/01/11 04:30:07 PM LDT postfix/pickup[10896] AB43220444: uid=1000 from=<tomc> 05/01/11 04:30:07 PM LDT postfix/cleanup[6737] AB43220444: message-id=<20110501223007.AB43220444@LDT> 05/01/11 04:30:07 PM LDT postfix/qmgr[5016] AB43220444: from=<tomc@LDT>, size=939, nrcpt=1 (queue active) 05/01/11 04:30:07 PM LDT postfix/local[6739] AB43220444: to=<tomc@LDT>, orig_to=<tomc>, relay=local, delay=0.11, delays=0.07/0/0/0.04, dsn=2.0.0, status=sent (delivered to mailbox) 05/01/11 04:30:07 PM LDT postfix/qmgr[5016] AB43220444: removed
Now - what'a that "mailbox" referred to
----- (earlier posting -----
I'm new to both Task Scheduler and Bash, and I'm somehow getting things wrong.
What I want to do is have a script executed by cron twice a week to check for updates to my installed Ruby Version Manager. Here's my rvm-update.sh script -
Code:
#!/bin/sh # rvm-update.sh: updates Ruby Version Manager, when run by cron # # t. cloyd 2011.05.01 ################################################ echo date && BEGIN rvm update from rvm-update script rvm get latest > rvm-update-log.txt rvm reload echo date && END rem update exit ###### eof #####
Code:
05/01/11 12:00:02 PM LDT CRON[5054] (tomc) CMD (/home/tomc/rvm-update.sh) 05/01/11 12:00:02 PM LDT postfix/pickup[5017] 4315C1FF37: uid=1000 from=<tomc> 05/01/11 12:00:02 PM LDT postfix/cleanup[5058] 4315C1FF37: message-id=<20110501180002.4315C1FF37@LDT> 05/01/11 12:00:02 PM LDT postfix/qmgr[5016] 4315C1FF37: from=<tomc@LDT>, size=607, nrcpt=1 (queue active) 05/01/11 12:00:02 PM LDT postfix/local[5060] 4315C1FF37: to=<tomc@LDT>, orig_to=<tomc>, relay=local, delay=0.32, delays=0.19/0.06/0/0.06, dsn=2.0.0, status=sent (delivered to mailbox) 05/01/11 12:00:02 PM LDT postfix/qmgr[5016] 4315C1FF37: removed
But the noon cron run didn't do any of this - no terminal screen, and my run log file, which had content, from last night's test runs, was wholly empty. I ran it manually again this afternoon, and it all worked. I set it to run every minutes via cron, and it does exactly what the noon run did - no log output, and now it's generating log errors (which I don't understand, and Google's not helping me, yet...):
Code:
05/01/11 04:13:01 PM LDT CRON[6768] (tomc) CMD (/home/tomc/rvm-update.sh) 05/01/11 04:13:01 PM LDT CRON[6767] (CRON) error (grandchild #6768 failed with exit status 127) 05/01/11 04:13:01 PM LDT postfix/pickup[6017] 2399220444: uid=1000 from=<tomc> 05/01/11 04:13:01 PM LDT postfix/cleanup[6737] 2399220444: message-id=<20110501221301.2399220444@LDT> 05/01/11 04:13:01 PM LDT postfix/qmgr[5016] 2399220444: from=<tomc@LDT>, size=663, nrcpt=1 (queue active) 05/01/11 04:13:01 PM LDT postfix/local[6739] 2399220444: to=<tomc@LDT>, orig_to=<tomc>, relay=local, delay=0.1, delays=0.07/0/0/0.03, dsn=2.0.0, status=sent (delivered to mailbox) 05/01/11 04:13:01 PM LDT postfix/qmgr[5016] 2399220444: removed
Comment