Linux.com

cron running scripts

Link to this post 25 May 09

I ma unfamiliar with git so bear with me, could this be an issue were you user account that is used to run the job as insufficient rights to git?

Link to this post 25 May 09

Just to be shure...

Did you try the touch-script with absolute path in crontab?
Perhaps ~/script.sh expands to /root/script.sh as cron is run as root (?)

If you tried an absolute path with the git-script and
just redirected stdout the file is blank because it just tells you that there is no repository on stderr and exits.

Basti

Link to this post 25 May 09

@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. >_<;

Link to this post 25 May 09

Hi,

I thought your script produces an error and you won't see that in the output file if you had an entry like

* * * * * script.sh > output.txt

because that redirects only stdout.

The last thing I can imagine is that you have to use the full path of touch like:


#!/bin/bash
/usr/bin/touch /home/dennis/delme.txt

and see if that works...

To see where it is installed type

which touch

Basti

Link to this post 30 May 09

@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. :)

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board