Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Unix command (in PHP)?

Contributor ,
Nov 20, 2013 Nov 20, 2013

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

TOPICS
Server side applications
687
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 20, 2013 Nov 20, 2013
LATEST

>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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines