Remove @restart cronjob using bash

I am trying to remove an @restart cronjob using bash and sed. The cronjob entry looks like this

@reboot /opt/nzbget/nzbget -D

I have tried using the help posted here but it uses regex and non-@reboot cronjobs so doesn’t work

I did try adapting it but failed

crontab -l | sed "/@reboot /opt/nzbget/nzbget -D/" | crontab -

Source: bash

Leave a Reply