-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnextcloud-backup.env
More file actions
141 lines (114 loc) · 6.05 KB
/
Copy pathnextcloud-backup.env
File metadata and controls
141 lines (114 loc) · 6.05 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# ==============================================================================
# nextcloud-backup.env — Configuration for nextcloud-backup.sh
# ==============================================================================
# Place this file in the same directory as nextcloud-backup.sh.
# The script reads all configuration from here; the script itself must never
# be modified for configuration purposes.
#
# Variables are grouped into REQUIRED and OPTIONAL sections.
# • REQUIRED — must be set; the script aborts if any are missing or empty.
# • OPTIONAL — have built-in defaults; may be left empty or omitted.
# ==============================================================================
# ==============================================================================
# DATABASE — REQUIRED
# ==============================================================================
# Connection details for the Nextcloud database.
#
# Minimum privileges required for DB_USER:
# SELECT, LOCK TABLES, SHOW VIEW, TRIGGER, EVENT, PROCESS
#
# Example for MariaDB (run as root or admin):
# CREATE USER 'backup_user'@'localhost' IDENTIFIED BY 'strong-password';
# GRANT SELECT, LOCK TABLES, SHOW VIEW, TRIGGER, EVENT, PROCESS
# ON nextcloud.* TO 'backup_user'@'localhost';
# FLUSH PRIVILEGES;
# ==============================================================================
DB_HOST="localhost"
DB_NAME="nextcloud"
DB_USER="root"
DB_PASSWORD="CHANGEME"
# ==============================================================================
# NEXTCLOUD — REQUIRED
# ==============================================================================
# Absolute path to the root of the Nextcloud installation.
# This is the directory that contains index.php, occ, config/, data/, etc.
# ==============================================================================
NC_DIR="/var/www/nextcloud"
# ==============================================================================
# WEB SERVER USER — REQUIRED
# ==============================================================================
# The OS user that owns the Nextcloud files and runs the PHP/web-server process.
# Used to invoke `occ` with the correct filesystem identity so that file
# ownership and Nextcloud session state remain consistent.
# ==============================================================================
WEB_USER="www-data"
# ==============================================================================
# BACKUP STORAGE — REQUIRED
# ==============================================================================
# Absolute path to the directory where completed backup archives are stored.
# The directory is created automatically if it does not already exist.
# Ensure the underlying filesystem has sufficient free space (≥ 3× NC_DIR).
# ==============================================================================
BACKUP_ROOT="/opt/nextcloud-backup"
# ==============================================================================
# INCLUDES — OPTIONAL (default: entire NC_DIR)
# ==============================================================================
# An array of directory or file names relative to NC_DIR to include in the
# backup archive. When this array is empty (the default), the entire NC_DIR
# tree is archived.
#
# Paths must be relative to NC_DIR — do NOT use leading slashes or NC_DIR
# itself as a prefix.
#
# Example — archive only config, data, and apps:
# INCLUDES=("config" "data" "apps")
# ==============================================================================
INCLUDES=()
# ==============================================================================
# EXCLUDES — OPTIONAL
# ==============================================================================
# An array of --exclude= patterns that are passed to tar. Patterns are
# relative to NC_DIR — do NOT include "nextcloud-directory/" as a prefix;
# the script adds that prefix automatically before passing patterns to tar.
#
# The patterns listed below are ALWAYS applied regardless of whether
# this array is empty or not. Add entries here only to exclude additional
# paths on top of those permanent defaults.
# ==============================================================================
EXCLUDES=(
"--exclude=updater-*"
"--exclude=data/*/cache"
"--exclude=data/*/thumbnails"
"--exclude=data/appdata_*/preview"
"--exclude=data/appdata_*/appstore"
"--exclude=data/*/files_trashbin"
)
# ==============================================================================
# RETENTION_DAYS — OPTIONAL (default: 7)
# ==============================================================================
# Archives in BACKUP_ROOT that are older than this many days are removed
# automatically at the end of a successful backup run.
# Set to 0 to disable automatic rotation entirely.
# ==============================================================================
RETENTION_DAYS=7
# ==============================================================================
# XZ_LEVEL — OPTIONAL (default: 6)
# ==============================================================================
# xz compression level applied when building the archive.
# 0 — fastest compression, largest file size
# 6 — balanced default (recommended)
# 9 — maximum compression, slowest; use only when storage is severely limited
# ==============================================================================
XZ_LEVEL=6
# ==============================================================================
# NTFY_URL — OPTIONAL (default: empty — notifications disabled)
# ==============================================================================
# Full URL of an ntfy topic endpoint to receive push notifications for backup
# start, success, and failure events.
# Leave empty (or omit the variable) to disable notifications entirely.
# Notification delivery failures never abort the backup.
#
# Example:
# NTFY_URL="https://ntfy.sh/my-nextcloud-backup-alerts"
# ==============================================================================
NTFY_URL=""