Run docker command in bash file and run using crontab

前端 未结 1 526
面向向阳花
面向向阳花 2021-01-24 07:59
#!/bin/bash

docker exec -ti erpnext sh -c \"cd /home/frappe/frappe-bench/ &&
/usr/local/bin/bench backup\"

echo \'Hello, world.\' >foo.txt

相关标签:
1条回答
  • 2021-01-24 08:33

    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

    docker exec erpnext sh -c "cd /home/frappe/frappe-bench/ && /usr/local/bin/bench backup"
    
    0 讨论(0)
提交回复
热议问题