0

I am writing some C++ code and would like that every 60 minutes, the code is "uploaded" to my external SVN repository. For doing this I just do "svn ci -m "some comment", but I want to do it automatically, so forget about this. I am working in mac os x, so I thought about using crontab but get some errors and I can not make it work. Do you know about a better solution?

P.S. This is what I did. First "crontab -e", then added the line

mac:temp john$ crontab -l
# m h  dom mon dow   command
0,5,10,15,20,25,30,35,40,45,50,55 * * * * /Users/john/Desktop/temp/add.sh  

and I checked out that the script add.sh has execution permissions. I do not exactly get an error, the thing is that the script, supposed to run every 5 minutes, does not run at all. The same thing runs in linux perfectly

2
  • Can you provide the error's you are getting with crontab? If you are looking for an alternative there is always Automator. support.apple.com/kb/ht2488 May 30, 2011 at 9:17
  • Please state what exactly you are using in Crontab and which errors you get. We can't help you otherwise.
    – slhck
    May 30, 2011 at 9:18

1 Answer 1

0

I'll assume you have created a cron job but you get errors when it runs. It would be helpful to let us know what the errors are, but the most frequent issue people have with cron jobs is not specifying full paths in commands and files, or not having some other environment variable set that is required for the task

Running your script when logged in locally, you have a different set of environment paths that won't necessarily be there when cron executes your script. If your script expects the current working directory to be somewhere specific, make sure you cd to that directory within the script you are running.

Basically, when you create a script that you want to run, make sure you:

  1. Specify all paths fully

  2. Change directory if appropriate

  3. Set any environment variables that are required for your script/commands

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .