Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
329 views
in Technique[技术] by (71.8m points)

Bash Script with docker commands not running via Crontab

hey guys not sure what I am doing wrong here, but was hoping for some help.

I have a bash script with the following.

#!/bin/bash
docker exec -t wekan-db bash -c "scripts/wekandb_backup.sh" 
docker exec -t wekan-db bash -c "rm -r /dump/*; cp -r /mongodb_backup/ /dump/mongodb_backup"
docker cp wekan-db:/dump /home/ikadmin/codes/backup/wekan/$(date +%Y-%m-%d) 

Everything executes correctly when I run the bash script from the terminal.

However when I try to run it via crontab -e it does not work. Logs do show crontab trying to run it.

Just in case the bash script is currently set as 777 as well.

Any help would be appreciated

EDIT: crontab command

19 8 * * * /bin/bash /home/ikadmin/codes/scripts/backup-wekan-docker.sh
question from:https://stackoverflow.com/questions/65885562/bash-script-with-docker-commands-not-running-via-crontab

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...