Copy link to clipboard
Copied
Im trying to build a script that will monitor a folder for files that are dropped into it and write to a log file when a new file is dropped{ File name, current time:for when it was dropped, and creation date}. From the file I will have PHP get the file contents, and parse/explode the data so I can place it onto a page (tracking page)
Is there a way to use a shell script the unix in PHP to to this?
(Don't regularly use unix so I'm not familular with all it can do)
Thanks
Copy link to clipboard
Copied
>Is there a way to use a shell script the unix in PHP to to this?
Not sure I understand this sentence. Are you wanting to execute a shell script from within a php script? If so, see if 'shell_exec' is what you need.
http://php.net/manual/en/function.shell-exec.php
I'm also not sure why you'd want to call your unix script that monitors the folder from a php script. Why not use a cron job? How is the php script invoked?