Bug with crontab editor

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

Have you considered placing your command in a shell script to keep the contents cleaner?

That way you can simply call /path/to/your/script instead of trying to place your command and options directly in the crontab.

1 Like

I actually just went with -delete instead of -exec rm -rf {} ;

But the point is, that having an ; in the cron, seems to break it :slight_smile:

1 Like

Please keep bugs in:

2 Likes

Done: [Bug] Crontab editor opening existing cron that has a ; in the command · Issue #4329 · hestiacp/hestiacp · GitHub

2 Likes

It makes keeping track of it 10 times easier :slight_smile:

3 Likes