#!/bin/sh # dump.bitcheese.net backup script # stores current dump backup id in BACKUP_ID_FILE because ipfs dos not allow ipns pinning yet BACKUP_ID_FILE=$HOME/.dump-backup-is BACKUP_ID="" if [ -f "$BACKUP_ID_FILE" ] then BACKUP_ID=`cat $BACKUP_ID_FILE` fi NEW_BACKUP_ID=`ipfs name resolve /ipns/QmUVuK32prRah8FDuCv1Hoz8pSksX9yUwr49EcPkMKo9XE` if [ "$NEW_BACKUP_ID" != "$BACKUP_ID" -a ! -z "$NEW_BACKUP_ID" ] then if [ ! -z "$BACKUP_ID" ] then ipfs pin rm "$BACKUP_ID" fi echo "$NEW_BACKUP_ID" > "$BACKUP_ID_FILE" ipfs pin add "$NEW_BACKUP_ID" fi