#!/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/QmWd2szXHDAMBpiJHLFXxYD4NqS4R6KggL3L2H4NsXv7Mp` if [ "$NEW_BACKUP_ID" != "$BACKUP_ID" -a ! -z "$NEW_BACKUP_ID" ] then if [ ! -z "$BACKUP_ID" ] then ipfs pin update "$BACKUP_ID" "$NEW_BACKUP_ID" else ipfs pin add --progress "$NEW_BACKUP_ID" fi echo "$NEW_BACKUP_ID" > "$BACKUP_ID_FILE" fi