this is a backup script
-sharp!/bin/bash
docker_name=mysql_container
data_dir=/home/ubuntu/mysql_dump
/usr/bin/docker exec -it $docker_name /usr/bin/mysqldump -u root -p root --all-databases > "$data_dir/data_`date +%Y%m%d`.sql"
A file with data can be generated by using sh directly, but through the scheduled task * / bin/sh / home/ubuntu/mysql_dump/mysql_dumps.sh
, the backup file can be generated and the file content is empty. What is the situation?