Jump to content

Need help with pup exec


dwest100

Recommended Posts

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 by dwest100
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.