Add Cron Job does not escape space correctly

I started using HestiaCP 1.9.3 on a Ubuntu 24.04, and I am pretty happy with it so far.

Setup:

  • open a shell session as a HestiaCP user. Run “mkdir folder-with\ space-in-name”
  • log on to HestiaCP web interface as that user, go to CRON > Add Cron Job
    • in the Command, type “cd folder-with\ space-in-name; ls -al >> mycron.log 2>&1” (without double-quotes); set some frequency, and save

Problem/bug:

  • the web UI stripped the backslash.
  • when it runs, it fails because the job attempts to do “cd folder-with” (a non-existent folder)
  • I cannot even edit the job. Clicking on the cron item in the list opens an empty “Edit Cron Job”. The only thing I can do is to delete the job

Workaround:

  • use single quotes, as in “cd ‘folder-with space-in-name’; ls -al >> mycron.log 2>&1”
  • do not use space in folder names

However, I believe the UI should be better behaved in dealing with escape characters. At least it should open an item for editing.

This appears similar (same root cause) as Adding a cron job using curl to access a url containing & does not execute successfully, nor does it add \ in front of &

Thanks