Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Crontab editor opening existing cron that has a ; in the command #4329

Open
youradds opened this issue Mar 14, 2024 · 3 comments · May be fixed by #4353
Open

[Bug] Crontab editor opening existing cron that has a ; in the command #4329

youradds opened this issue Mar 14, 2024 · 3 comments · May be fixed by #4353
Labels
bug Something isn't working

Comments

@youradds
Copy link
Contributor

youradds commented Mar 14, 2024

Describe the bug

It seems like there is a bug with the crontab editor. This cron:

find /home/sterba/web/xx.net/public_html/images-tmp -type d -ctime +2 -exec rm -rf {} \;

It added ok - but now I’m trying to edit, I just get a blank form with nothing pre-filled :} After opening up the cron.conf file and doing some testing, I see:

JOB='10' MIN='0' HOUR='12' DAY='*' MONTH='*' WDAY='*' CMD='find /home/sterba/web/xx.net/public_html/images-tmp -type d -ctime +2 -exec rm -rf {} \;' SUSPENDED='no' TIME='16:17:22' DATE='2023-12-06'
The issue seems to be around the ; bit. Interestingly, if I remove the \ from it, it works :slight_smile: I’m not sure where the code is around that - so maybe someone else could find it? I’m re-working that cron anyway as I’m going in another direction, but just thought I’d point it out :slight_smile:

Cheers

Andy

Tell us how to replicate the bug

  1. Add a new cronjob with: find /home/sterba/web/xx.net/public_html/images-tmp -type d -ctime +2 -exec rm -rf {} \;
  2. go back and edit it - you will see the values are missing
  3. Edit the cron.conf file so that it has just ; and not ; , and then try again - it will work this time

Which components are affected by this bug?

Control Panel Web Interface

Hestia Control Panel Version

1.8.11

Operating system

ubuntu 22.04

Log capture

No response

@youradds youradds added the bug Something isn't working label Mar 14, 2024
@Anuril
Copy link
Contributor

Anuril commented Apr 4, 2024

The issue here is the \ ...

The error is caused by entering find /home/sterba/web/xx.net/public_html/images-tmp -type d -ctime +2 -exec rm -rf {} \;

@youradds
Copy link
Contributor Author

youradds commented Apr 4, 2024

@Anuril appologies - yes, its \; not just ; . It saves the cron ok - but when it gets rendered back, it gets confused as then ; messes things up I think. Not too sure how to get around it (I've gone with a different approach now - but this may come up in others crons) . After writing this reply, it also removed the \ - so it must be a github thing. I've put it in backticks to force it to code - so its should show now :)

@Anuril
Copy link
Contributor

Anuril commented Apr 4, 2024

I'll look into this and push a fix

@Anuril Anuril linked a pull request Apr 4, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants