Skip to main content

Is there any variable that cron setsets when it's runningit runs a program ? If the script is runningrun by cron, I'llI would like to skip some parts; otherwise invoke those parts.

How can I know if the bashBash script is started by cron ?

Is there any variable that cron set when it's running a program ? If the script is running by cron, I'll skip some parts; otherwise invoke those parts.

How can I know if the bash script is started by cron ?

Is there any variable that cron sets when it runs a program ? If the script is run by cron, I would like to skip some parts; otherwise invoke those parts.

How can I know if the Bash script is started by cron ?

Tweeted twitter.com/#!/StackUnix/status/241505866052956160
edited title
Link
daisy
  • 55.9k
  • 80
  • 253
  • 406

Check if script is started by cron, rather than invoked manually

Source Link
daisy
  • 55.9k
  • 80
  • 253
  • 406

Check if script is started by cron

Is there any variable that cron set when it's running a program ? If the script is running by cron, I'll skip some parts; otherwise invoke those parts.

How can I know if the bash script is started by cron ?