Lewati ke isi

Pencadangan berkas menggunakan restic

# donwload
curl -LO https://github.com/restic/restic/releases/download/v0.9.0/restic_0.9.0_linux_amd64.bz2
# extract
bunzip2 restic*
# install
sudo cp restic* /usr/local/bin/restic
sudo chmod a+x /usr/local/bin/restic
# test
restic
#
nano ~/.restic-env
echo 'source ~/.restic-env' >> ~/.zshrc
export AWS_ACCESS_KEY_ID="AGY3Q2BRX2TS7YUMPU2R"
export AWS_SECRET_ACCESS_KEY="y4aUeHKNB3OKwyUvJUJmE1MOLAX24tcvWD/cZwy7DfE"
export RESTIC_REPOSITORY="s3:sgp1.digitaloceanspaces.com/agihan"
export RESTIC_PASSWORD="gGFfZdakr+NAU7sWDXY6tX7LsR5BcUEJ"
# testing
mkdir -p restic-test
echo "sharks have no organs for producing sound" >> ~/restic-test/facts.txt
# backup testing
restic backup ~/restic-test/facts.txt
#
restic snapshots
#
mkdir -p /tmp/restore
restic restore 0d6440a0 --target /tmp/restore
crontab -e
#
0 0 * * * . /home/deploy/.restic-env; /usr/local/bin/restic backup -q /mnt/vol02-agihan/data; /usr/local/bin/restic forget -q --prune --keep-monthly 6