Well, kind of. If you look in your /etc/crontab file, you will see that it is set up to run a program named "run-parts" on the various /etc/cron.* directories every so often. It will run "run-parts /etc/cron.hourly" at the beginning of each hour. What that run-parts script does is look in the directory it is given and run each program in there.
So if you make a link to proftpd in there, it will run it every hour, even if it is already running. This is probably not what you want, unless proftpd detects that another copy is already running and exits cleanly. You can probably do that and it will just log a message saying that the FTP server couldn't start up every hour.
A better solution is to write a little shell script that checks to see if proftpd is running or not (using ps or something), and runs it only if it is not already running. This won't fill up your log files.
You can't make a symlink with arguments. To do what you want with apachectl, you should create a shell script and put that in /etc/cron.hourly. Try something like this:
#! /bin/sh
cmd=/usr/local/apache2/bin/apachectl
if $cmd status
then : # Apache is running
else $cmd start # Apache was stopped: start it again.
fi
That should work, but check the exit code from "apachectl status" to see if I've gotten the test right. I don't remember just what it returns in various conditions.
|