Jump to content

Check if shell_exec is successful


themistral

Recommended Posts

Hi guys,

 

I'm running the following code:

$result = shell_exec("su user; scp /path/to/file/text.txt  user@domain:/path/to/file/text.txt");

 

Now, the file get's transferred correctly.

However, I need to put in place a check to check if the transfer was successful.

 

$result seems to return the same whether the transfer was successful or not.

 

I want to send an email to state whether the file transfer was successful so what do I need to do to check this?

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/259410-check-if-shell_exec-is-successful/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.