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.
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
|
|
|
What about simply setting up the command in the crontrab to redirect stdout to a file (>> for append)? Something like: XX XX XX XX XX /path/to/cmd >> outputfile.log |
|||
|
|