|home| |posts| |projects| |cv| |bookmarks| |github|

Backup Sqlite Db

https://litestream.io/alternatives/cron/

#!/bin/bash -x

# Ensure script stops when commands fail.
set -e

# Backup & compress our database to the temp directory.
sqlite3 /path/to/db "VACUUM INTO '/path/to/backup'"
gzip /tmp/db

# Upload backup to S3 using a rolling daily naming scheme.
aws s3 cp /tmp/db.gz s3://mybucket/db-`date +%d`.gz

# Notify dead man that back up completed successfully.
curl -d s=$? https://nosnch.in/xxxxxxxxxx &> /dev/null

0 0 * * * /path/to/script.sh

https://conitor.io https://deadmanssnitch.com/

docker run -p 9000:9000 -p 9001:9001 minio/minio server /data --console-address ":9001"

wget https://dl.min.io/client/mc/release/linux-amd64/mc

https://min.io/docs/minio/linux/reference/minio-mc.html

mc alias set linode xxx access_key secret_key
mc cp file linode/bucket/file
mc cp linode/bucket/file file