Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CodiMD backup script (with uploads)
#!/bin/sh
d='/home/backuper/backups'
container_d='/home/backuper/codimd-container'
d="$d/tmp"
mkdir -p "$d"
docker run --rm -v codimd-container_uploads:/uploads \
-v "$d":/bkp \
alpine tar cf /bkp/uploads.tar /uploads/*
(cd "$container_d" && docker-compose exec database pg_dump hackmd -U hackmd) > "$d/db.sql"
7zr a "$d/../codimd-`date +'%FT%H'`.7z" "$d/*"
rm -rf "$d"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.