Skip to content

Unpause tasks #24

Closed
Closed

Description

@cerede2000

When you pause a task, it disappears from Cronmaster...

Therefore it is not possible to put it back into operation.
Other than editing the target user's crontab file to remove the comment from the line, it's not very practical.

Can you add a task management feature so you can reactivate paused tasks?

Thanks :)

Activity

  1. fccview commented on Aug 31, 2025

    @fccview
    Owner

    Hi,
    That should not be the case, pausing shouldn't remove the task from the UI, and you should be able to play it again.

    Everything has been tested by me and a few other users, the only known bug around edit is this one: #23

    Let's see if there's some misconfiguration going on, what version of cronmaster are you running?

  2. cerede2000 commented on Aug 31, 2025

    @cerede2000
    Author

    I use v1.3.0 :
    Image

    I have one task:
    Image

    When I pause it:
    Image

    Image

    Interestingly, if I manually reactivate the task by removing only the # from the task line but leaving # Paused:
    Image

    And I pause in Cronmaster again:
    Image

    Image

    In fact when there is # PAUSED: PAUSED: it works!

    If edit again and remove second PAUSED:
    Image

    Task disappear...
    Image

  3. fccview commented on Aug 31, 2025

    @fccview
    Owner

    That's quite interesting actually.
    Could you do me one more favour before i dig deep into this one, can you create a second task and see if things works well with two tasks?

    I wonder if the issue is having only one task (still a bug, but it's good to understand where it's coming from, i'm currently from mobile, just fixed another bug, as soon as i have a moment i'll fix this one too!)

  4. cerede2000 commented on Aug 31, 2025

    @cerede2000
    Author

    No problem :)

    I did the requested test and the same with two tasks:
    Image

    Image

    And :D
    Image

    Image
  5. cerede2000 commented on Aug 31, 2025

    @cerede2000
    Author

    I found the bug :)

    In line-manipulation.ts file line 168:
    if (trimmedLine.startsWith("# PAUSED: ")) {

    You are literally testing '# PAUSED: ' with a space at the end of the string!

    Only when I edit my crontab after pausing '# PAUSED:' is written to the file without a space after...
    And you also trim while reading

    Which explains why it works when there is something else after e.g. '# PAUSED: !'
    Image

    Image

    Remove the space at the end of '# PAUSED: ' at all locations :)

  6. fccview commented on Aug 31, 2025

    @fccview
    Owner

    Oh wow, so the bug only happens on tasks without comments, AMAZING find!
    I'll get on it as soon as i am done with the auth/pwa feature request i've pushed through a minute ago, may be tomorrow/tuesday at the latest, thank you so much for pinpointing this, will save me tons of time

  7. cerede2000 commented on Sep 1, 2025

    @cerede2000
    Author

    I'd like to add a suggestion: why handle the pause on an additional line?
    In case of an accidental edit, the pause comment could be shifted.

    Wouldn't it be better if the pause comment were placed directly on the task line?

    Example: # CRM:PAUSED:0 */4 * * * /server/scripts/update-ygg-api.sh
    CRM = CronMaster :D

    For the description, it would be wise to do the same.

    Comment at the end of the line, for example:
    0 */4 * * * /server/scripts/update-ygg-api.sh # CRM:Desc:Test description

    See you generate a pattern like #CRM:PAUSED and #<CRM:DESC:Test description>

    Always on the same line as the task concerned, this limits line problems, line shifts in the event of manual editing or other.

  8. fccview commented on Sep 1, 2025

    @fccview
    Owner

    This is fixed as part of pull request #28

    I thought about your suggestion to move the PAUSED before the command rather than comment, and I admit it would have been a better implementation, however we need to think about the current userbase, this would be a breaking change and they'd need to manually fix their cronjobs. I have just simply removed the space from PAUSED as you very kindly pointed out and that sorts the issue nicely.

    Also i'd rather not add much before/after the command as I'll need to enable logging at some point, and that'll likely be an extra manipulation on the command.

  9. fccview commented on Sep 1, 2025

    @fccview
    Owner

    This has officially been sorted in the latest 1.4.0 release.
    Please let me know if you run into ani issues, I'll close this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions