Bench init frappe-bench error on Ubuntu 22 LTS

Hello everyone!

I am following the instructions on this page: Installation

When I get to the second to last command: bench init frappe-bench

I see the error:

 DONE  Total Build Time: 20.132s

 WARN  Cannot connect to redis_cache to update assets_json
 WARN  Cannot connect to redis_cache to update assets_json
 WARN  Cannot connect to redis_cache to update assets_json
Done in 23.86s.
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/bench/commands/make.py", line 68, in init
    init(
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/system.py", line 107, in init
    bench.setup.backups()
  File "/usr/local/lib/python3.10/dist-packages/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/bench/bench.py", line 437, in backups
    system_crontab = CronTab(user=user)
  File "/usr/local/lib/python3.10/dist-packages/crontab.py", line 228, in __init__
    self.read(tabfile)
  File "/usr/local/lib/python3.10/dist-packages/crontab.py", line 291, in read
    (out, err) = open_pipe(self.cron_command, l='', **self.user_opt).communicate()
  File "/usr/local/lib/python3.10/dist-packages/crontab.py", line 190, in open_pipe
    return sp.Popen(args, stdout=sp.PIPE, stderr=sp.PIPE, env=env)
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/crontab'

ERROR: There was a problem while creating frappe-bench

Could anyone enlighten me as to what might be wrong?

Thank you!

You don’t have crontab installed, which is a system dependency? if you don’t want automatic backups, there should be a flag to do so - check bench init --help

You are right, thank you!

Ubuntu 22 does not have cron installed by default :crazy_face:. I just had to run sudo apt install cron