backup_config.sh 1.76 KB
Newer Older
Daniel Stan's avatar
Daniel Stan committed
1

Daniel Stan's avatar
Daniel Stan committed
2 3
# command="/usr/bin/env ORIGIN=kugel /home/dstan/scripts-perso/backup-enc-recv ${SSH_ORIGINAL_COMMAND#* }",no-port-forwarding,no-X11-forwarding,no-pty

4 5 6 7 8 9 10 11 12 13 14 15
case "$(hostname)" in
  "ailesv")
    # Path to the backup fs
    FS_DIR=/home
    
    # Path to the backup directory (form FS_DIR)
    BACK_DIR=.snapshot
    
    # Extra filter for volumes (sed syntax)
    PATTERN=1d_.*
    
    # REMOTE command SSH
16
    REMOTE='ssh kugel.tudo.re -i /root/send_snap_home_kugel /root/scripts-perso/backup-recv'
17 18 19 20 21 22
    ;;
  "gigapudding")
    # Path to the backup fs
    FS_DIR=/mnt/backup
    
    # Path to the backup directory (form FS_DIR)
23
    BACK_DIR="$ORIGIN"
24 25
    
    # Extra filter for volumes (sed syntax)
26
    if [ "$ORIGIN" = "kugel" ]; then
Daniel Stan's avatar
Daniel Stan committed
27
        PATTERN=1d_.*
Daniel Stan's avatar
Daniel Stan committed
28
    elif [ "$ORIGIN" = "ailesv" ]; then
29
        PATTERN=1d_.*
Daniel Stan's avatar
Daniel Stan committed
30 31 32
    else
        echo '$ORIGIN not provided or invalid, aborting.'
        exit 10
33
    fi
34
    ;;
Daniel Stan's avatar
Daniel Stan committed
35 36 37 38 39 40 41 42 43 44
  "kugel")
    GPG_E="gpg -e -r daniel.stan@crans.org"
    if [ "$ORIGIN" = "kugel" ]; then
      # Path to the backup fs
      FS_DIR=/home
      
      # Path to the backup directory (form FS_DIR)
      BACK_DIR=.snapshot
      
      # Extra filter for volumes (sed syntax)
45
      PATTERN="1d_.*"
Daniel Stan's avatar
Daniel Stan committed
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
      
      # REMOTE command SSH
      REMOTE="ssh dstan@gigapudding.crans.org -i /root/backup_kugel_giga /home/dstan/scripts-perso/backup-enc-recv"
    else
      # Path to the backup fs
      FS_DIR=/mnt/backup
      
      # Path to the backup directory (form FS_DIR)
      BACK_DIR=ailesv
      
      # Extra filter for volumes (sed syntax)
      PATTERN=1d_.*
      
      # REMOTE command SSH
      REMOTE="ssh dstan@gigapudding.crans.org -i /root/backup_ailesv_giga /home/dstan/scripts-perso/backup-enc-recv"
    fi
    ;;
63
  *)
Daniel Stan's avatar
Daniel Stan committed
64 65
    echo "Unknown host !";
    exit 1
66 67
    ;;
esac
Daniel Stan's avatar
Daniel Stan committed
68