First: if this is in the wrong place, I apologize.

I'm a newcomer to Linux, but I'm trying to learn what I need to in order to correctly use it.

I've got a program I need to run multiple times, without my having to do anything. The book on Linux I've got mentioned the 'crontab' command, but I'm not sure I understand how to use it correctly. I tried to set up a call to the program I needed the way the book demonstrated, and nothing happened. Similarly, I've looked at a couple of websites found via a google search, but they simply showed the same kinds of examples as the book.

Basically, I need to know the correct way to set up a job with crontab, and the correct way to make sure it runs when it's supposed to.

I'm not sure if this information is needed to determine the cause, but I think the server I'm working on is running Suse 9. (Remote connection; I may not be correct in this.)

Anyone out there willing to take pity on this ignorant newbie?

Thanks in advance,
-EnderX

Recommended Answers

All 4 Replies

Is cron actually running? It won't do any good to setup the process to run every x hours, if cron itself isn't. You can check what's currently running by typing "ps -aux" into the command prompt. It might be quite a long list, so you may want to pipe it:

ps -aux |more

And if cron or something with "cron" isn't listed, then you know what the problem is.

commented: Useful information to remember. +1

I tried that command. There is an entry in the output called /usr/sbin/cron. Is that what I'm supposed to be looking for?

I may have stumbled onto a different problem for this. I've tried running the program I'm working with seperately, and it doesn't seem to properly if I'm not in the same directory as it. I've been trying to use the full pathname for the program though, so I don't understand why it doesn't want to work. Any suggestions?

I tried that command. There is an entry in the output called /usr/sbin/cron. Is that what I'm supposed to be looking for?

Yes.

I may have stumbled onto a different problem for this. I've tried running the program I'm working with seperately, and it doesn't seem to properly if I'm not in the same directory as it. I've been trying to use the full pathname for the program though, so I don't understand why it doesn't want to work.

What happens? Does bash give you an error, or does the program itself have trouble running?

Sorry for not responding earlier, but I believe I found the problem.
As I said, I was attempting to type the entire path name into the setup, and it wasn't running correctly. But by including a cd command to get to the correct directory, then ./ing my program, it seems to be working properly.

Thanks for the assistance.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.