1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# Cockup configuration template. Save this output as a .yaml file and edit it.
# Required for a standalone config; optional for an include-only ingredient.
# Included ingredients inherit the enclosing symlink policy.
# Values: reference (copy the link), dereference (copy its target), prompt (ask once).
symlinks: reference
# Required for a standalone config; optional for an include-only ingredient.
# The backup directory is relative to this YAML file.
destination: backup
# Optional: clean removes existing backup contents before copying (default: false).
# clean: false
# Optional: metadata preserves file/link timestamps and supported flags (default: true).
# metadata: true
# Optional: include imports rules and hooks before the local ones (default: []).
# Each entry must specify exactly one of file or ingredient.
# File paths are relative to the YAML file declaring them.
# include:
# # file names a local YAML configuration.
# - file: other.yaml
# # Optional: wrap prefixes all imported backup paths (default: no prefix).
# # Use a non-empty relative path without '..'; nested wrappers compose.
# wrap: imported
# # Optional: symlinks overrides the inherited mode for this include subtree.
# symlinks: dereference
# # Optional: metadata overrides the inherited value for this include subtree.
# metadata: false
# # ingredient names a YAML file from the Cockup GitHub library.
# - ingredient: ghostty
# wrap: ghostty
# Required: rules lists files to back up and restore; [] is a valid starting point.
rules:
# Example rule (replace rules: [] above when ready):
# rules:
# # Required within a rule: from is the source directory or glob.
# - from: ~/Library/Preferences
# # Required within a rule: to is a relative path inside destination.
# to: preferences
# # Optional: targets selects names or globs below from (default: []).
# targets: ['*.plist']
# # Optional: symlinks overrides the inherited mode for this rule.
# symlinks: reference
# # Optional: metadata overrides the inherited value for this rule.
# metadata: true
# # Optional: on-start hooks run before this rule (default: []).
# on-start:
# - name: Before preferences
# command: 'echo ''Starting preferences'''
# # Optional: on-end hooks run after this rule (default: []).
# on-end:
# - name: After preferences
# command: 'echo ''Finished preferences'''
# Optional: hooks contains lifecycle hook lists (default: empty lists).
# Hooks run sequentially; command and check are shell strings run by /bin/sh -cu.
# Arrays are not supported. Quote expanded paths and variables; -u rejects unset variables.
# hooks:
# # Optional: pre-backup hooks run before backup file changes (default: []).
# pre-backup:
# # Required within a hook: name labels the hook.
# - name: Example check
# # Required within a hook: command is a nonempty shell string (or YAML | block).
# command: 'echo ready'
# # Optional: check runs only if command succeeds (default: omitted).
# check: 'test -d .'
# # Optional: cwd overrides the working directory for command and check.
# # '~' uses your home; relative paths use this YAML's directory.
# # Default: the hook's existing lifecycle working directory.
# cwd: .
# # Optional: output prints command/check output (default: false).
# output: true
# # Optional: timeout is seconds per command and per check (default: none).
# # Input time counts; a timeout kills only the shell, not its descendants.
# timeout: 5
# # Optional: env adds or overrides environment variables (default: {}).
# env:
# EXAMPLE: ready
# # Optional: post-backup hooks run after backup rules (default: []).
# post-backup: []
# # Optional: pre-restore hooks run before restore file changes (default: []).
# pre-restore: []
# # Optional: post-restore hooks run after restore rules (default: []).
# post-restore: []