Closed Nebukadnezzar1 closed 3 years ago
Solution:
Since Sebastix's commands are slightly different to Jorijn, I missed one important detail. For the cron, I have to reduce my command by -it
and the second docker
statement.
Working command:
* * * * $(command -v docker) run --rm --env-file=/home/ubuntu/.env ghcr.io/sebastix/crypto-dca:latest buy 10 ADA --yes
The appended -yes
will automatically execute the purchase without asking for confirmation.
@Nebukadnezzar1 Missed this issue, but nice to read you've found the solution! Thanks for the compliment. You don't need the docker -it
parameter in a cron command because you can't interact (providing input) with a cronjob. I'll close the comment.
Experienced issue: The command
* * * * * $(command -v docker) docker run --rm -it --env-file=/home/ubuntu/.env ghcr.io/sebastix/crypto-dca:latest buy 10 ADA
won't start. This is tested within the filesThe log E-Mail always prints :
If I run the command manually (without cron), it works like a charm (
docker run --rm -it --env-file=/home/ubuntu/.env ghcr.io/sebastix/crypto-dca:latest buy 10 ADA
). Same applies fordocker run --rm -it --env-file=/home/ubuntu/.env ghcr.io/sebastix/crypto-dca:latest balance
👍My System: I'm running on a Raspberry Pi 4 with ubuntu OS 20.04.3 LTS 64bit. Docker itself was installed natively (
sudo apt install docker.io
) Docker compose was set up using Python3-pip (you know, the aarch64 architecture issues with docker...)Output of
docker version
:Output of
docker info
:Output of
docker image inspect [imageID]
:Output of
sudo crontab -e
:Aside from the issue: Great work by the both of you (Jorijn and Sebastix)! I love the idea to set up & host my own crypto-dca bot. #Kudos!