yes, exist
OK, sorry I've made a mistake Try this
#!/bin/sh
cd /home/ubuntu/appwrite
mkdir -p backup
/usr/local/bin/docker-compose -f /home/ubuntu/appwrite/docker-compose.yml exec mariadb sh -c 'exec mysqldump --all-databases --add-drop-database -u"$MYSQL_USER" -p"$MYSQL_PASSWORD"' > ./backup/dump.sql
appwrite_volumes=(uploads cache config certificates functions)
for volume in ${appwrite_volumes[@]}; do
mkdir -p backup && docker run --rm --volumes-from "$(docker-compose ps -q appwrite)" -v $PWD/backup:/backup ubuntu bash -c "cd /storage/$volume && tar cvf /backup/$volume.tar ."
done
I continue with the problem. Thank you so much for your time and effort!
did you get it working?
Not yet 🥲
weird...so btw, you shouldn't need to run sudo with docker. you may have missed a post installation step: https://docs.docker.com/engine/install/linux-postinstall/
i tested by adding a cron job for my user (rather than root). the cron job had:
*/5 * * * * cd [path to appwrite folder] && ./backup.sh
I used the original backup.sh script.
I wonder if you have a problem with docker compose for your root account
everything happens normally when I run the backup.sh script directly in cmd
Files are generated
Yes of course. The problem is with cron path
perhaps it would be good to try and get some output. try to update your crontab command to:
cd /home/ubuntu/appwrite && ./backup.sh > /tmp/cron-backup.log 2>&1
./
./app-63ab55ce4321283aa7fe/
./app-63ab55ce4321283aa7fe/63c9aa8377f9fb2109d7/```
I get this error: the input device is not a TTY
the rest is basically the same as normal operation
Interesting that it doesn't work for you though...
You can try adding -T flag to the docker compose command
I no longer get the TTY error and the file is still empty
How did you install docker?
Can you test docker compose version in the script? You can probably comment out everything else while we troubleshoot the docker compose problem
like this link
this is an old docker compose 👀 you need docker compose v2
you should definitely try and uninstall that old compose. maybe it was installed via pip?
@Drake @Binyamin after updating everything, docker and docker-compose the problem was solved. I really appreciate your help!
[SOLVED] Cron for backup 💾
checking
Please don't post in an old thread like this. If you need help, create a new post
Recommended threads
- Go 1.25 runtime
So I'm trying to use go 1.25 for my functions and I can only find go-1.23 as a function runtime. So I did some searching and found https://github.com/appwrite/a...
- Failed to generate functions SSL
```appwrite-worker-certificates | Cannot renew domain (functions.domain.com) on attempt no. 9 certificate: Failed to verify domain DNS records. appwrite-worker...
- Dart 3.10 runtime on self-host 1.8.1
I added dart-3.10 runtime in .env file, applied the changes, but cannot see such option on console. is dart 3.10 not supported by self hosted 1.8.1? if not, whe...