Install ports from PHP-Shell (portsnap fetch should not be run non-interactively.)

Hey there,

I am using a PHP-Script to install ports.

PHP:
$ssh->exec("portsnap fetch extract")

But it still gives me this error.
Code:
Result: portsnap fetch should not be run non-interactively. Run portsnap cron instead.

Is there another way to do this via php? [cmd=]portsnap cron[/cmd] is not a solution for me).
 
/usr/bin/portsnap is just a shell script, sh's manpage says:
Code:
     -i interactive
             Force the shell to behave interactively.

Note there's probably a good reason you're getting this error. I don't use portsnap, so I don't know why, I just tested it, and it doesn't *seem* interactive ...
 
The reason is that if run from cron(8), # portsnap cron should be used instead of # portsnap fetch to avoid hammering the portsnap(8) server at the exact hour, usually 3 AM. This is done by waiting a random amount of time before actually making the connection.
 
Back
Top