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!

cPanel Cron API - linekey while removing

Discussion in 'General Discussion' started by Chirag Aggarwal, Jan 31, 2018.

Tags:
  1. Chirag Aggarwal

    Joined:
    Jan 9, 2018
    Messages:
    18
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hello,

    I ran into problems with removing cron with API 2. The add_line returns key named keyline while remove_line needs the count number for cron which is not given in the response of add_line.

    Possible workout I've found is using fetchcron and looping through it for that specific keyline. Is there any direct way?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    The Cron::remove_line cPanel API 2 function does not support entering a linekey obtained when adding the cron job. Instead, it only supports the use of a line number. You could also manually edit the crontab file via the "crontab -e" command to remove a line, or by directly editing the /var/spool/cron/$username file.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice