0

Have got a shell script which has been running a couple of years without a problem. It's very simple - just runs dos2unix on some files, each time checking the exit code and aborting the script if $? is not 0.

Wednesday last week dos2unix started giving an error code of 1, so aborting the script. No apparent changes were made on the server and if I run the script from the command line it works - just not when started by cron.

The conversion seems to happen ok but the issue is when it is renaming the temp file created by dos2unix.

Seems like it should be really simple but I have run out of ideas what to check or try next. Anyone have any ideas?

  • 1
    Does the cron still runs from the same user as commandline? Add `set -x` to your script and redirect (in crontab line, including `2>@1`) to a `/tmp` file. That file might reveal the root cause. – Walter A Apr 16 '16 at 07:12
  • Which version of dos2unix are you using? Try the latest version (7.3.3). It may give you better error messages. – Erwin Waterlander Apr 19 '16 at 06:55

0 Answers0