config.example.yaml

Tue, 06 Feb 2018 20:16:59 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Tue, 06 Feb 2018 20:16:59 +0000
changeset 111
c3bc27cf5ece
parent 97
96d5adbe0205
permissions
-rw-r--r--

Changed dreamtime calculation.
The monotonic clock (time.monotonic()) sometimes advances unreliably
in sleep, so isn't reliable for calculating sleeping time. We have to
use time.time(). But this may be changed by the user, so we only use
it to track sleep periods, and still use time.monotonic() to track
wake periods.

#
# Borgend example configuration file
#

# General parameters for borg
borg:
  executable: /usr/local/bin/borg
  common_parameters:
  create_parameters:
    - exclude-from: $HOME/lib/borg-exclude-patterns.txt
  prune_parameters:
    # Set borg pruning parameters. The pruning interval is configured
    # in each separate backup. NOTE: Pruning parameters can also be
    # configured separately for each backup.
    #
    # Keep a daily archive for the last week
    - keep-daily: 7
    # Keep a weely archive for the last year
    - keep-weekly: 52
    # Keep a montly archive forever
    - keep-monthly: -1
    # Set to true to enable a dry-run
    - dry-run: False

# Repositories: configure here locations, passphrases,
# and general access parameters
repositories:
  - name: myserver
    location: ssh://myserver.invalid/~/storage/borg
    keychain_account: borg-backup@mylaptop
    # Borg parameters
    common_parameters:
      # Borg is installed on remote host at ~/bin, which might not be on path
      - remote-path: ~/bin/borg
    create_parameters:
      - compression: lzma
      - checkpoint-interval: 600

  - name: backup1
    location: /Volumes/backup1/borg
    keychain_account: borg-backup@mylaptop

# Backups: configure here which files should be backed up, how frequently, and to
# which repositires.
backups:
  # 1. Most files in $HOME to ssh://myserver.invalid
  - name: Home to 'myserver'
    # Scheduling mode: dreamtime/realtime/manual
    # Dreamtime scheduling discounts system sleep periods.
    scheduling: dreamtime
    # Backup every 24 hours
    backup_interval: 86400
    # Retry every 15 minutes if unable to connect / unfinished backup
    retry_interval: 900
    # Prune interval: once every two weeks
    prune_interval: 1209600
    # Repository and archive configuration
    repository: myserver
    archive_prefix: 'all@mylaptop-'
    archive_template: '{now:%Y-%m-%d_%H:%M:%S}'
    # Files to include
    paths:
      - $HOME
    create_parameters:
      - pattern: "- $HOME/Downloads/"
      - pattern: "- $HOME/Library/Mail/V*/MailData/"
      - pattern: "+ $HOME/Library/Mail/"
      - pattern: "+ $HOME/Library/Mobile Documents/"
      - pattern: "- $HOME/Library/"
      - pattern: "- $HOME/.config/borg/security/"

  # 2. A subset of files $HOME more frequently to ssh://myserver.invalid
  - name: Work to 'myserver'
    # Scheduling mode: dreamtime/realtime/manual
    scheduling: dreamtime
    # Backup every 3 hours
    backup_interval: 10800
    # Retry every 15 minutes if unable to connect / unfinished backup
    retry_interval: 900
    # Prune interval: once every two weeks
    prune_interval: 1209600
    # Repository and archive configuration
    repository: myserver
    archive_prefix: 'work@mylaptop-'
    archive_template: '{now:%Y-%m-%d_%H:%M:%S}'
    paths:
      - $HOME/work

  # 3. Manual backup to external hard drive
  - name: Home to 'backup1'
   # Manual backup
   scheduling: manual
   backup_interval: 0
   retry_interval: 0
   prune_interval: 0
   repository: backup1
   archive_prefix: 'mylaptop-'
   archive_template: '{now:%Y-%m-%d_%H:%M:%S}'
   paths:
     - $HOME
   create_parameters:
     - pattern: "- $HOME/Downloads/"
     - pattern: "- $HOME/Library/Mail/V*/MailData/"
     - pattern: "+ $HOME/Library/Mail/"
     - pattern: "+ $HOME/Library/Mobile Documents/"
     - pattern: "- $HOME/Library/"
     - pattern: "- $HOME/.config/borg/security/"

mercurial