@bastlib
Wow, that actually worked. I was using full paths in the crontab and in the script itself for the file to touch, but I wasn't using the commands' full paths.
Thanks everyone for your help. :)
@bastlib
Wow, that actually worked. I was using full paths in the crontab and in the script itself for the file to touch, but I wasn't using the commands' full paths.
Thanks everyone for your help. :)
@mfillpot
I don't think it's an issue with git. I tried other test scripts as well and none of them worked.
@bastlib
I used absolute paths with all the test scripts (and in crontab) and none of them worked. I also tried giving everyone permission to read, write, and execute the script to see if that helped (sudo chmod a+rwx script). It didn't. :(
...and just redirected stdout the file is blank because it just tells you that there is no repository on stderr and exits.
I'm not sure what you mean by this... Could you explain? I'm a noob. >_<;
@mfillpot
When I run it from the terminal it works fine.
Created commit 0c2664e: Commit on Sun May 24 10:58:40 EDT 2009
1 files changed, 1 insertions(+), 0 deletions(-)
create mode 100644 .gitignore
@bastib I tried a couple of different scripts using full path names; none of them run.
I tried doing
#!/bin/bash
touch /home/dennis/testing
And it doesn't run.
@mfillpot I just tried it with the sh in front. It still doesn't work. :(
Hi. I've been reading about cron and I think it's a pretty useful utility. However, I've had a bit of trouble with it running scripts.
I'm running Ubuntu 9.04 with Gnome, by the way.
For example, if I put the following line into my crontab
* * * * * ~/script
(I've tried variations of this using the full path to the script and the $HOME variable.)
And I wait a minute or so, nothing happens. In the System Log Viewer an entry in syslog is added every minute saying that the script was being run, but nothing actually happens. I tried redirecting the output to a file, but the file is blank after the script is run. No errors are shown. I tried "sudo chmod a+rwx" on the script (just in case the script wasn't being run due to permissions issues) but it still isn't working...
Crontab works for other things though. I use it as an alarm clock with
30 5 * * * export DISPLAY=:0 && firefox pandora.com
...and it works as expected.
I'm confused as to why I can't seem to get the program to run the script, or failing that give any sort of error message.
My script, by the way, isn't that complicated, and it works properly when running it regularly...
#!/bin/bash
git add .
git commit -m "Commit on `date`"
Has anyone dealt with this issue before? Any help would be appreciated. :)
~Dennis
The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.
Join / Linux Training / Board