Solaris/bash: “no: command not found”

At work we have a script, that rsyncs a bunch of files from one server to the other, nothing special. The script works perfectly when run manually from a shell, but does not when run via crontab. The error message does not really point to anything:

no: command not found

What is the “no” command and why and who tries to call it!?

Well, what happened was: I though I was being clever and used RSYNC=$(which rsync) to find the rsync command to execute. Unfortunately rsync actually is located in /usr/local/bin on this system and /usr/local/bin is not in the PATH, so which could not find it. Running the script from a shell worked, because that user just happened to have /usr/local/bin appended to it’s PATH environment variable. The “no” comes from the message which returns when it cannot find the command:

no rsync in /usr/bin /sbin /usr/sbin /bin /usr/bin
  • email
  • PDF
  • Google Bookmarks
  • Yahoo! Bookmarks
  • del.icio.us
  • Twitter
  • Reddit
  • Digg
  • Ping.fm
  • Slashdot
  • Facebook
  • MySpace
  • Technorati
  • NewsVine
  • Tumblr
  • StumbleUpon

Leave a Reply