#!/bin/bash docker exec -ti erpnext sh -c \"cd /home/frappe/frappe-bench/ && /usr/local/bin/bench backup\" echo \'Hello, world.\' >foo.txt
The -ti requests to use a pseudo-tty and run in interactive mode but cron does not attach to any TTY. Try removing -ti as in
-ti
docker exec erpnext sh -c "cd /home/frappe/frappe-bench/ && /usr/local/bin/bench backup"