Is there a simple way to determine whether a shell script was initiated via cron or manually by the user? In my case, I want the script to send output to a log file when run via cron, but to
stdout when initiated manually.
What about simply setting up the command in the crontrab to redirect stdout to a file (>> for append)?
XX XX XX XX XX /path/to/cmd >> outputfile.log