3

I'm setting up a crontab to auto generate our Doxygen documentation every day. I'd like to just have a single command that does this rather than creating a .sh file that does it. My question is that normally I run doxygen CONFIGFILE in the current directory that I want to generate the documentation for. I'd like to set this up on cron so it happens every morning, but since the command is run in the current directory I can't.... how can I make it so in a single cron command it knows which directory to run the command on?

1 Answer 1

10

You can run multiple commands on one crontab line e.g.

30 5 * * *  cd /path/to/working/directory && /path/to/doxygen CONFIGFILE

The && will only run the second command if the first completes successfully.

Note that the PATH for CRON is generally not the same as your interactive PATH so using full pathnames to commands is generally a good practice.

0

You must log in to answer this question.

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