Jump to content

problems with starting by crond


tip78

Recommended Posts

Posted

hello

my os is centos 6.5

a simple script:

#!/bin/sh

/path/to/file/mta-server >/dev/null 2>&1 &

(or mta-server -d)

is not working from crond but perfectly starting server if runs by hands

why?

  • MTA Team
Posted

please expand the script. Check if the server is running before you start it. If it is already running you should not attempt to start another instance. That's bad practice. Also, do not send the output from the server to /dev/null, use the -d switch to deamonize, that's what it is there for. That way, when the server fails to start or crashes, the output can be recorded.

If the crond fails to execute the script, check the syslog to see why it crashed. Some distributions also send a mail to your inbox for every failed cronjob.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...