I'm using crontab with a @reboot entry which starts a script containing a endless while-loop that is processing the output of a tail -F command. Is there any way to stop the currently running script and restart the @reboot rule without a actual reboot? I'm running Debian 6.

  • 2
    Your question sounds very much like you want to use an init script instead of a crontab rule. – scai Dec 3 '13 at 8:37

I'm assuming you know the name of the script (use pkill), or can find out its processid (ps aux, then kill -9). Then start it again using the same command as in crontab. If you want to detach the process from the session, you can use nhup, or dtach or something similar.

Its pretty trivial. A better way to do this would be to write a init (or upstart or systemd) script, so you can just stop and start the service from there. This will depend on your distro, however.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.