6

I have installed a cron job to run at 4 AM every day however it is not being executed.

If I run the script manually it executes with no problem so I don't think permissions are the issue.

I checked the log and have found the cron is being started with the following lines

Jul  4 04:00:01 Server /USR/SBIN/CRON[30888]: (log-transfer-user) CMD (/home/log-transfer-user/scripts/execute_script.sh^M)
Jul  4 04:00:01 Server /USR/SBIN/CRON[30887]: (CRON) info (No MTA installed, discarding output)

For some reason ^M is being appended to the path of the script. Could this be the issue?

1 Answer 1

9

You have carriage return (CR) at the end of the line, as the log says:

/home/log-transfer-user/scripts/execute_script.sh^M

You need to remove the CR and also put a newline after the line as needed by cron.

1
  • ... and perhaps install Postfix as MTA ? It could come handy. ;-)
    – Cbhihe
    Jul 5, 2016 at 7:51

You must log in to answer this question.

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