dwest100 Posted February 13, 2017 Share Posted February 13, 2017 (edited) Code: function set_server_jobs() { $permalink = 'https://www.jameswestpaintings.net/about/'; $auction_end_delayed = '23:40'; $curl_command = 'curl ' . $permalink . ' | at ' . $auction_end_delayed; shell_exec("'" . $curl_command . "'"); //echo $curl_command; } add_shortcode('test_curl', 'set_server_jobs'); Question: (Using Wordpress, thus the shortcode) I'm trying to get $curl_command to execute on the server but it isn't working. I echoed the command for testing and it is concatenated correctly. When I run atq on the bash shell no job is listed...meaning none was created by the exec sent to the server. What am I doing wrong? Thanks! Edited February 13, 2017 by dwest100 Quote Link to comment https://forums.phpfreaks.com/topic/303177-need-help-with-pup-exec/ Share on other sites More sharing options...
requinix Posted February 13, 2017 Share Posted February 13, 2017 I imagine that the job is being killed off when the shell exits. Don't do this anyways. Use cron to set up a regular job, even if that job runs every minute and doesn't do anything. Store the information needed (like the permalink) somewhere and have the cronjob scan for jobs and process them. Quote Link to comment https://forums.phpfreaks.com/topic/303177-need-help-with-pup-exec/#findComment-1542693 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.