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.

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:
    13
    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:
    41,484
    Likes Received:
    1,612
    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.
     
Loading...

Share This Page