GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    kaia (kaia@brotka.st)'s status on Saturday, 30-Nov-2024 23:17:27 JST kaia kaia

    does someone want to review our backup to backblaze script courtesy of ClaudeAI? seems to work!

    #!/bin/bash BACKUP_DIR="backup" BUCKET_NAME="" DATE=$(date +%Y%m%d) BACKUP_FILE="$DATE-akkoma.pgdump" ENCRYPTED_FILE="${BACKUP_FILE}.enc" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" export B2_APPLICATION_KEY_ID="" export B2_APPLICATION_KEY="" # Your encryption key - store this securely! ENCRYPTION_KEY="" # Stop docker compose docker compose down akkoma # Create backup docker compose exec db pg_dump -d akkoma --format=custom -f /backup/$BACKUP_FILE # Start docker compose again docker compose up akkoma # Encrypt the backup openssl enc -aes-256-cbc -salt -in "./$BACKUP_DIR/$BACKUP_FILE" -out "./$BACKUP_DIR/$ENCRYPTED_FILE" -k "$ENCRYPTION_KEY" -pbkdf2 # Upload encrypted file to B2 if $SCRIPT_DIR/venv/bin/b2 file upload $BUCKET_NAME "./$BACKUP_DIR/$ENCRYPTED_FILE" "backups/$ENCRYPTED_FILE"; then # Delete local files only if upload was successful rm "./$BACKUP_DIR/$BACKUP_FILE" "./$BACKUP_DIR/$ENCRYPTED_FILE" echo "Backup completed, encrypted, and uploaded successfully" else echo "Upload failed - keeping local backup files" exit 1 fi
    In conversation about 6 months ago from brotka.st permalink
    • Embed this notice
      Anton (antondollmaier@mastodon.social)'s status on Saturday, 30-Nov-2024 23:32:41 JST Anton Anton
      in reply to

      @kaia suggestion: use restic: https://restic.readthedocs.io/en/stable/

      It can upload to b2 natively, is a single go binary, and the pg_dump command can be called directly, thus you'd end up with a single command for the backup. Encryption is also handled natively, so no additional openssl required.
      I'd need to verify the exact command, don't have it out of my head.
      The script itself looks good to me.

      In conversation about 6 months ago permalink

      Attachments


      kaia likes this.
    • Embed this notice
      kaia (kaia@brotka.st)'s status on Saturday, 30-Nov-2024 23:34:09 JST kaia kaia
      in reply to
      • Anton
      @antondollmaier thanks, checking out! :kaia_loo]
      In conversation about 6 months ago permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.