How to know whether my program is being execute manually or by cron or from another script

Digimon Digitizer 2

My question is stated in the title:

How can I discover whether my program is being execute manually or by cron or from another script, and what account is being used?

I hope you guys can help me.

Jim Garrison

You can get the parent PID with getppid.

Then finding the parent process name from its PID is non-portable. On linux/unix you could run the ps command and parse the output. On Windows you'll probably need something like Win32::Process::List. No idea for OSX or other operating systems, try Googling perl get process name from pid.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to execute a php script from another php script by using the shell?

From Dev

How to tell if my program is being piped to another (Perl)

From Dev

How to ignore file types from being archived in my shell script?

From Dev

How to know whether my application is visible or not?

From Dev

PHP - How to know if PHP script is being run via a Cron

From Dev

How to open xterm from script being runned by cron?

From Dev

gdb how to execute target program from script

From Dev

Why won't cron execute my node.js script?

From Dev

How to execute a php script from another php script?

From Dev

how can python program run another python program as if it is being run from separate SSH terminal?

From Dev

How to know whether QTableWidget's cell is (not) being edited?

From Dev

How can my script determine whether it's being run by bash or dash?

From Dev

How can my script determine whether it's being run by bash or dash?

From Dev

How to run a script from another path, and know the script's path?

From Dev

How to ignore file types from being archived in my shell script?

From Dev

how to execute a python (2.7) script from a c program in Windows

From Dev

How to execute SQL script in directory from another script?

From Dev

Robot Framework : How to know whether a test library function is being executed from setup/test/teardown

From Dev

How to execute a php script from another php script?

From Dev

How to open another program from my first in C#?

From Dev

How to know whether an app is being terminating in iOS?

From Dev

how to execute program which is in my environment variable in a bash script

From Dev

How to determine whether a script is run at startup or manually?

From Dev

PHP SDK-How to know whether or not person from Facebook has installed and authorized my app on Facebook?

From Dev

How to execute Groovy script within Grails by Cron

From Dev

How to know whether am the administrator of my Ubuntu?

From Dev

(Unix/Linux) How would I execute a C program from another C program that requires an input file?

From Dev

How to check if a script is being called from terminal or from another script

From Dev

How to get path to bash script independent of whether it is sourced from bash or from another script?

Related Related

  1. 1

    How to execute a php script from another php script by using the shell?

  2. 2

    How to tell if my program is being piped to another (Perl)

  3. 3

    How to ignore file types from being archived in my shell script?

  4. 4

    How to know whether my application is visible or not?

  5. 5

    PHP - How to know if PHP script is being run via a Cron

  6. 6

    How to open xterm from script being runned by cron?

  7. 7

    gdb how to execute target program from script

  8. 8

    Why won't cron execute my node.js script?

  9. 9

    How to execute a php script from another php script?

  10. 10

    how can python program run another python program as if it is being run from separate SSH terminal?

  11. 11

    How to know whether QTableWidget's cell is (not) being edited?

  12. 12

    How can my script determine whether it's being run by bash or dash?

  13. 13

    How can my script determine whether it's being run by bash or dash?

  14. 14

    How to run a script from another path, and know the script's path?

  15. 15

    How to ignore file types from being archived in my shell script?

  16. 16

    how to execute a python (2.7) script from a c program in Windows

  17. 17

    How to execute SQL script in directory from another script?

  18. 18

    Robot Framework : How to know whether a test library function is being executed from setup/test/teardown

  19. 19

    How to execute a php script from another php script?

  20. 20

    How to open another program from my first in C#?

  21. 21

    How to know whether an app is being terminating in iOS?

  22. 22

    how to execute program which is in my environment variable in a bash script

  23. 23

    How to determine whether a script is run at startup or manually?

  24. 24

    PHP SDK-How to know whether or not person from Facebook has installed and authorized my app on Facebook?

  25. 25

    How to execute Groovy script within Grails by Cron

  26. 26

    How to know whether am the administrator of my Ubuntu?

  27. 27

    (Unix/Linux) How would I execute a C program from another C program that requires an input file?

  28. 28

    How to check if a script is being called from terminal or from another script

  29. 29

    How to get path to bash script independent of whether it is sourced from bash or from another script?

HotTag

Archive