Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED Running Cron Job with Dedicated IP Address

Discussion in 'General Discussion' started by WMisiedjan, Mar 6, 2018.

  1. WMisiedjan

    WMisiedjan Registered

    Joined:
    Mar 6, 2018
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    Dear CPanellers,

    I have a VPS running WHM and cPanel with multiple accounts, I have bought a secondary IP address for a dedicated account. Let's call this account for this purpose account X.

    On account X I want to run a PHP cronjob that runs twice daily FROM that specific IP address, I've been searching for hours and I haven't found a solution.

    Anyone any tips or advice on how to achieve this?

    Kind Regards,
    Wendell Misiedjan
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,182
    Likes Received:
    1,756
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Can you elaborate on the specific action you are attempting to perform via a cron job? For instance, do you mean you want the outgoing IP address to show as the dedicated IP?

    Thank you.
     
  3. WMisiedjan

    WMisiedjan Registered

    Joined:
    Mar 6, 2018
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    Yes, so whatever the cron job is preforming should have an outgoing IP address of the dedicated IP address assigned to it, this doesn't seem to be the case right now.
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,182
    Likes Received:
    1,756
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    It's normal for outgoing connections to come from the default public IP address of the server. Assigning an account a dedicated IP address will not change this behavior. You may need to consult with a system administrator to see if any custom network configurations are possible for the behavior you are seeking, as I'm not aware of any easily configurable settings you could alter to make it work.

    Thank you.
     
  5. WMisiedjan

    WMisiedjan Registered

    Joined:
    Mar 6, 2018
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    I guess I have to turn myself into an system administrator, thank you.
     
  6. WMisiedjan

    WMisiedjan Registered

    Joined:
    Mar 6, 2018
    Messages:
    4
    Likes Received:
    1
    Trophy Points:
    3
    Location:
    Netherlands
    cPanel Access Level:
    Root Administrator
    For the people finding this and wanting to do this for a PHP script that is using cURL, you can set your actually set the current option in cURL;

    ```CURLOPT_INTERFACE = xxx.xxx.xxx.xxx```

    where xxx's are the IP adres you want to use.
     
    cPanelMichael likes this.
Loading...

Share This Page