Outils pour utilisateurs

Outils du site


tech:notes_sauvegardes_backup_avec_restic

Ceci est une ancienne révision du document !


Notes sauvegardes backup avec Restic

Restic - L’excellent outil de sauvegarde de fichiers

Voir : https://restic.net/

Voir aussi :

  • Rclone
  • Les outils de sauvegrade en mode block tel que Bup
  • Kopia.io

Exemple avec rclone

rclone serve restic --addr localhost:8889 --user foo --pass s3kr1t remote:bucket/path
export RESTIC_REPOSITORY='rest:http://foo:s3kr1t@localhost:8889'
export RESTIC_PASSWORD=Password123
restic init
restic snapshots
restic stats
restic find --tag Plop '*'
restic backup /data/
find ~/bin/ -maxdepth 1 -type f -print0 | restic backup --tag plop --files-from-raw=/dev/stdin
restic ls -l latest
mkdir mnt
restic mount mnt/ &
ls -l ~/mnt/snapshots/latest/
$ ls mnt/
hosts  ids  snapshots  tags

Maintenance

restic check
restic prune
 
restic migrate 
restic migrate upgrade_repo_v2
restic migrate 

Remove snapshot

restic snapshots 
 
restic forget 5bb4af18
 
restic prune

bin/backup.sh

#! /bin/bash
 
set -euo pipefail
 
# export RESTIC_REPOSITORY='rest:http://localhost:8889'                                                                                                                                                             # export RESTIC_PASSWORD=P@ssw0rd
 
# shellcheck source=/home/management/.backup.env
source ~/.backup.env
 
do_rclone_listen() {
    rclone serve restic --addr localhost:8889 e_nas:/restic1
}
 
do_backup() {
    restic backup --tag code ~/code/
    restic backup --tag code ~/*.env
    restic backup --tag blob ~/Work/
    restic backup --tag tools ~/go/bin/
    restic backup --exclude='tmp/' --tag blob /mnt/c/DATA/
    find ~/bin/ -maxdepth 1 -type f -print0 | restic backup --tag script --files-from-raw=/dev/stdin
}
 
do_post_backup() {
    restic prune
}
 
main() {
    do_rclone_listen &
    sleep 1
    do_backup
    do_post_backup
    killall rclone
    echo OK
}
 
main
tech/notes_sauvegardes_backup_avec_restic.1747737805.txt.gz · Dernière modification : de Jean-Baptiste

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki