forked from M-Labs/it-infra
nixbld: also store backups on zfs tank
This commit is contained in:
parent
bb1320e576
commit
c49e1fbade
|
@ -7,6 +7,8 @@ let
|
|||
set -e
|
||||
umask 0077
|
||||
|
||||
FILENAME=backup-`date +%F`.tar.bz2.gpg
|
||||
|
||||
DBDUMPDIR=`mktemp -d`
|
||||
pushd $DBDUMPDIR
|
||||
|
||||
|
@ -16,7 +18,8 @@ let
|
|||
${pkgs.gnutar}/bin/tar cf - --exclude "/var/lib/gitea/repositories/*/*.git/archives" /etc/nixos /var/lib/gitea flarum.sql mattermost.sql | \
|
||||
${pkgs.bzip2}/bin/bzip2 | \
|
||||
${pkgs.gnupg}/bin/gpg --symmetric --batch --passphrase-file /etc/nixos/secret/backup-passphrase | \
|
||||
${pkgs.rclone}/bin/rclone rcat --config /etc/nixos/secret/rclone.conf dropbox:backup-`date +%F`.tar.bz2.gpg
|
||||
tee --output-error=warn /tank/backup/$FILENAME | \
|
||||
${pkgs.rclone}/bin/rclone rcat --config /etc/nixos/secret/rclone.conf dropbox:$FILENAME
|
||||
|
||||
popd
|
||||
rm -rf $DBDUMPDIR
|
||||
|
|
Loading…
Reference in New Issue