dugout-> disk_ops_id.dugout.
Build generic disk operations and routines. These include backups of standardized operation system components that utilize generic archive programs.
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
#!/bin/sh
###############################################################################
## COPYRIGHT (C) 2020-2026 NEW ENTITY OPERATIONS INC. ALL RIGHTS RESERVED
## INSTANCE: disk_ops_id.dugout
## MODIFIED: 2026/04/20
## OVERVIEW: Build generic disk-operations and routines. These include backups
## of standardized operation-system components that utilize generic archive
## programs. Archive programs may also be implemented using an implementation
## specific backup schema or program according to your backup needs.
##
## disk_id allows you to define setup DISK_ID_SLUG locations by storage-related
## access definitionsls
###############################################################################
## Backup Operations to Disk are complicated and this script does not help keep
## you safe if you misconfigure something or are being reckless with how you
## apply flags in the underlying backup program of your choice.
## Data loss can easily occur, and it does occur often - that's why the point
## of disk ops is to harden each operation with designated id-specific macros
##
## Please note*: All custom locations or non-standard ops are located in the
## disk_ops_id_custom.dugout file. The routines listed here are just generic
## backup routines implemented on many modern systems. Even if a location on
## your machine is considered standard to you, if it is not listed here, it
## is not thought to be standard by New Entity Operations Inc.
##
## ** NOTE ***
## BE CAREFUL when executing variable-scoped backups! All backups must be
## error-checked prior to execution.
##
## When in doubt, run a trial run first. Always catch all variables before
## utilizing them in a backup process.
##
## Consider the following points when running automated backup routines:
## 1.) The -z option typically is used to catch empty variables
## 2.) When transferring to/from a remote machine, or utilizing a network, use
## another .dugout template such as connection_mainframe.dugout,
## network_ops_id.dugout, or even run_program.dugout
## 3.) Comment out all backup scripts until they're TESTED with a dry run.
## 4.) If something fails, uncomment it and rework the flow until it's correct
## 5.) Don't allow non-working scripts to even be active within the system.
## 6.) You must use a wrapper to provide alerts for both verbose debugging and
## logging.
##
## The 2024 Backup Super-construct details
##
## The default backup user is root. This can be modified, but it is not
## recommended unless you are an advanced operator that knows how to do this
## properly.
##
## Under normal conditions, you'll need root access or have to provide it with
## something like sudo or similar.
##
## Other user automation account properties can be added when necessary in the
## system_blueprints_id.dugout file
##
## Some of these including:
## wineuser, dj, snoopy, and realmleader
## -> When an account is added, exclude the a directories
## -> Like this:
## --exclude=/home/$USER/*
## -> or use:
## --exlude-from=FILE.ds
##
## New Entity Linux: v.1.0 and New Entity OS (Reimplemented Kernel)
## -> New Entity Linux: Kernel 6.5.9 2023/11/01
## -> New Entity OS: Kernel 0.0.4 2024/01/01
##
## Either Kernels are valid for running automated disk operations.
##
## Features of the Linux version that are not available in the standard OS
## 1. apparmor enhancements
## 2. clamav/maldet enhancements
## 3. proxy-stack enabled and forwarding schemas and dns hardening
## 4. cron-enabled
## 5. visual-ques (sensory-enhancements) through conky/i3 status bars
## -> are enabled in both, but only in a limited capacity on NEOS
## 6. Traditional DBs, along with a generic and active light db: sqlite3
##
## *NOTE-> See all of the features in your IPDVC documentation that aren't
##
## Features available on both that have to do with automated backups
## 1. .CORE-> Codenamed TRINE (Cognitive Operations Resource Enclave)
## 2. Multi-array thread-limited backups
## 3. virtual-machine Narray backup exporting through FILTER
## -> Narray is the Alpha version of the "RING" framework that
## can speak directly to CORE.HOST
## 4. Icon-based operations pack enabled (NEW ENTITY 38 ICONS INCLUDED)
## 5. /srv instance for custom http I/O proxies and HTML interfaces
## 6. NOVA Framework API through "${VIRTUAL_CLOUD_ENVIRONMENT}"/NOVASTORE
## 7. /EXTRA custom-stack for additional binary system-enhancements
## 8. GATEWAY custom network runtime
## 9. IPDVC documentation and storage stack with EntityScript
## 10. .dugout enhancements and wrappers
##
## When excluding folders from the main backup, consider that these carry
## essential code/files/scripts for a functioning system.
##
## If you don't need these, you may choose to exclude them. If you do
## need them, skip this suggestion:
## --exclude=*ESSENTIAL_PART_1*
## --exclude=*ESSENTIAL_PART_N*
##
## Each backup script is bound by a run_backup_* function that is executed
## ideally through an alias in run_program.dugout
##
## The following labels are valid by default:
## 1.) A* - Main System storage, including full primary system backup and full
## primary backup cloning
## 2.) B* - Secondary conditional backups from the main primary backup
## 3.) C* - Partial primary system backups, represented as select instances
## 4.) X* - External System backups, primarily for cloning the primary system
## into another instance, such as a flash drive or anther HDD/SSD
## 5.) Y* - Secondary backups, branching what's excluded from a B* instance
## 6.) Z* - Additional Media Archives by category
##
## Any other label can be added with a unique purpose, such as D, E, F, etc.
##
## Increasing a number after the key A0... to A1 indicates a device format
## alteration, or a different realm of backup under 1 instance rule set
##
## For safety, ARCHIVE_MOCK=1 is standard. To remove it, set the environment
## variable to 0 manually, or in a linker-script
##
## Types of archiving
## archive_simple_no_rules
## Use-> archive_simple_no_rules <LOCATION_TO_BACKUP_FROM> <LOCATION_TO_BACKUP_TO>
##
## archive_generic_with_rules
## Use-> archive_generic_with_rules <LOCATION_TO_BACKUP_FROM> <LOCATION_TO_BACKUP_TO> <RULES>
##
## archive_simple_no_rules
## Use-> archive_simple_no_rules <LOCATION_TO_BACKUP_FROM> <LOCATION_TO_BACKUP_TO>
##
## archive_simple_with_rules
## Use-> archive_simple_with_rules <LOCATION_TO_BACKUP_FROM> <LOCATION_TO_BACKUP_TO> <RULES>
##
###############################################################################
## Select Media: Follow the run_backup_* convention where * is the alias
###############################################################################
## (A001) - Backup the default system to Generic Backup (HDD_SDD_TAPE_OR_NVME) <PATH>/SLUG_DISTRO: NOVA (TESTED 2025-02-07)
run_backup_NOVA() {
if [ -z "${BACKUP_NOVA_TO}" ]; then
alert_backup_to_location_not_valid "${BACKUP_NOVA_TO}"
else
## Define slugs: All 3 must exists except BACKUP_*_IGNORE_SLU, which
## defaults to a blank slot when empty
SLUG_BACKUP_NOVA_FROM="${BACKUP_NOVA_FROM}"
SLUG_BACKUP_NOVA_TO="${BACKUP_NOVA_TO}"
SLUG_BACKUP_NOVA_IGNORE="${BACKUP_NOVA_IGNORE}"
## requires super-user privs to see the locked nested directory
alert_disk_ops_full_archive_now
## Check slugs
if sudo [ -d "${SLUG_BACKUP_NOVA_FROM}" ]; then
# requires super-user privs to see the locked nested directory
alert_disk_ops_full_archive_started
alert_disk_ops_view_root_directory
confirm_view_directory "/"
if sudo [ -d "${SLUG_BACKUP_NOVA_TO}" ]; then
alert_disk_ops_directory_located "${SLUG_BACKUP_NOVA_TO}"
alert_disk_ops_locate_rules
if [ -f "${SLUG_BACKUP_NOVA_IGNORE}" ]; then
alert_backup_ruleset_defined "${SLUG_BACKUP_NOVA_IGNORE}"
while read -r SLUG_BACKUP_LOGIC
do
alert_backup_rule_instance "${SLUG_BACKUP_LOGIC}"
done < "${SLUG_BACKUP_NOVA_IGNORE}"
alert_backup_system_starting "${SLUG_BACKUP_NOVA_FROM}" "${SLUG_BACKUP_NOVA_TO}"
alert_disk_ops_initialized
archive_generic_with_rules "${SLUG_BACKUP_NOVA_FROM}" "${SLUG_BACKUP_NOVA_TO}" "${SLUG_BACKUP_NOVA_IGNORE}"
else
alert_backup_ruleset_not_defined
alert_backup_standard_starting "${SLUG_BACKUP_NOVA_FROM}" "${SLUG_BACKUP_NOVA_TO}"
SLUG_BACKUP_NOVA_IGNORE="NONE"
alert_disk_ops_initialized
if [ "${SLUG_BACKUP_NOVA_IGNORE}" = "NONE" ]; then
archive_simple_no_rules "${SLUG_BACKUP_NOVA_FROM}" "${SLUG_BACKUP_NOVA_TO}"
else
archive_generic_with_rules "${SLUG_BACKUP_NOVA_FROM}" "${SLUG_BACKUP_NOVA_TO}" "${SLUG_BACKUP_NOVA_IGNORE}"
fi
fi
else
alert_backup_location_not_valid "${SLUG_BACKUP_NOVA_TO}"
fi
else
alert_backup_from_location_not_valid "${SLUG_BACKUP_NOVA_FROM}"
fi
fi
}
###############################################################################
## Single instance main system slugs [Working: 2025/02/07]
###############################################################################
### (C001) - Backup of /etc
run_backup_etc() {
if [ -z "${BACKUP_ETC_TO}" ]; then
alert_backup_to_location_not_valid "${BACKUP_ETC_TO}"
else
## Define slugs: Assuming no exclusions
SLUG_BACKUP_ETC_FROM="${BACKUP_ETC_FROM}"
SLUG_BACKUP_ETC_TO="${BACKUP_ETC_TO}"
SLUG_BACKUP_ETC_IGNORE="NONE"
## Check slugs
if [ -d "${SLUG_BACKUP_ETC_FROM}" ]; then
alert_disk_ops_directory_generic_from "${SLUG_BACKUP_ETC_FROM}"
if [ -d "${SLUG_BACKUP_ETC_TO}" ]; then
alert_disk_ops_directory_slug_located "${SLUG_BACKUP_ETC_TO}"
alert_disk_ops_locate_rules
if [ "${SLUG_BACKUP_ETC_IGNORE}" = "NONE" ]; then
alert_backup_ruleset_not_defined
alert_backup_custom_starting "${SLUG_BACKUP_ETC_FROM}" "${SLUG_BACKUP_ETC_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_ETC_FROM}"
archive_generic_no_rules "${SLUG_BACKUP_ETC_FROM}" "${SLUG_BACKUP_ETC_TO}"
else
alert_backup_ruleset_defined "${SLUG_BACKUP_ETC_IGNORE}"
alert_backup_standard_starting "${SLUG_BACKUP_ETC_FROM}" "${SLUG_BACKUP_ETC_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_ETC_FROM}"
archive_generic_with_rules "${SLUG_BACKUP_ETC_FROM}" "${SLUG_BACKUP_ETC_TO}" "${SLUG_BACKUP_ETC_IGNORE}"
fi
else
alert_backup_location_not_valid "${SLUG_BACKUP_ETC_TO}"
fi
else
alert_backup_from_location_not_valid "${SLUG_BACKUP_ETC_FROM}"
fi
fi
}
## (C002) - Backup of /home
run_backup_home() {
if [ -z "${BACKUP_HOME_TO}" ]; then
alert_backup_to_location_not_valid "${PATH_HOME_TO}"
else
## Define slugs: Assuming no exclusions
SLUG_BACKUP_HOME_FROM="${BACKUP_HOME_FROM}"
SLUG_BACKUP_HOME_TO="${BACKUP_HOME_TO}"
SLUG_BACKUP_HOME_IGNORE="${BACKUP_HOME_IGNORE}"
## Check slugs
if [ -d "${SLUG_BACKUP_HOME_FROM}" ]; then
alert_disk_ops_directory_generic_from "${SLUG_BACKUP_HOME_FROM}"
if [ -d "${SLUG_BACKUP_HOME_TO}" ]; then
alert_disk_ops_directory_slug_located "${SLUG_BACKUP_HOME_TO}"
alert_disk_ops_locate_rules
if [ "${SLUG_BACKUP_HOME_IGNORE}" = "NONE" ]; then
alert_backup_ruleset_not_defined
alert_backup_custom_starting "${SLUG_BACKUP_HOME_FROM}" "${SLUG_BACKUP_HOME_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_HOME_FROM}"
archive_generic_no_rules "${SLUG_BACKUP_HOME_FROM}" "${SLUG_BACKUP_HOME_TO}"
else
alert_backup_ruleset_defined "${SLUG_BACKUP_HOME_IGNORE}"
alert_backup_standard_starting "${SLUG_BACKUP_HOME_FROM}" "${SLUG_BACKUP_HOME_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_HOME_FROM}"
archive_generic_with_rules "${SLUG_BACKUP_HOME_FROM}" "${SLUG_BACKUP_HOME_TO}" "${SLUG_BACKUP_HOME_IGNORE}"
fi
else
alert_backup_location_not_valid "${SLUG_BACKUP_HOME_TO}"
fi
else
alert_backup_from_location_not_valid "${SLUG_BACKUP_HOME_FROM}"
fi
fi
}
### (C002A) - Backup of the special instance
run_home_archive_special() {
if [ -z "${BACKUP_HOME_ARCHIVE_SPECIAL_TO}" ]; then
alert_backup_to_location_not_valid "${BACKUP_HOME_ARCHIVE_SPECIAL_TO}"
else
## Define slugs: Assuming no exclusions
SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM="${BACKUP_HOME_ARCHIVE_SPECIAL_FROM}"
SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_TO="${BACKUP_HOME_ARCHIVE_SPECIAL_TO}"
SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_IGNORE="${BACKUP_ARCHIVE_SPECIAL_IGNORE}"
## Check slugs
if [ -d "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM}" ]; then
alert_disk_ops_directory_generic_from "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM}"
if [ -d "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_TO}" ]; then
alert_disk_ops_directory_slug_located "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_TO}"
alert_disk_ops_locate_rules
if [ "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_IGNORE}" = "NONE" ]; then
alert_backup_ruleset_not_defined
alert_backup_custom_starting "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM}" "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM}"
archive_generic_no_rules "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM}" "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_TO}"
else
alert_backup_ruleset_defined "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_IGNORE}"
alert_backup_standard_starting "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM}" "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM}"
archive_generic_with_rules "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM}" "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_TO}" "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_IGNORE}"
fi
else
alert_backup_location_not_valid "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_TO}"
fi
else
alert_backup_from_location_not_valid "${SLUG_BACKUP_HOME_ARCHIVE_SPECIAL_FROM}"
fi
fi
}
## (C003) - Backup of /srv
## Dual backup schema: primary, secondary
run_backup_srv() {
## Define slugs: All 3 must exists except BACKUP_*_IGNORE_SLU, which
## defaults to a blank slot when empty
SLUG_BACKUP_SRV_FROM="${BACKUP_SRV_FROM}"
SLUG_BACKUP_SRV_TO_PRIMARY="${BACKUP_SRV_TO_PRIMARY}"
SLUG_BACKUP_SRV_TO_SECONDARY="${BACKUP_SRV_TO_SECONDARY}"
SLUG_BACKUP_SRV_IGNORE="${BACKUP_SRV_IGNORE}"
## Check slugs
if [ -d "${SLUG_BACKUP_SRV_FROM}" ]; then
alert_disk_ops_directory_generic_from "${SLUG_BACKUP_SRV_FROM}"
alert_disk_ops_redundant_archive_initialized
alert_backup_redundant_location "_TO_PRIMARY" "${SLUG_BACKUP_SRV_TO_PRIMARY}"
alert_backup_redundant_location "_TO_SECONDARY" "${SLUG_BACKUP_SRV_TO_SECONDARY}"
## _TO_PRIMARY
if [ -d "${SLUG_BACKUP_SRV_TO_PRIMARY}" ]; then
alert_disk_ops_directory_slug_located "${SLUG_BACKUP_SRV_TO_PRIMARY}"
alert_disk_ops_locate_rules
if [ -f "${SLUG_BACKUP_SRV_IGNORE}" ]; then
alert_backup_ruleset_defined "${SLUG_BACKUP_SRV_IGNORE}"
while read -r SLUG_BACKUP_LOGIC
do
alert_backup_rule_instance "${SLUG_BACKUP_LOGIC}"
done < "$SLUG_BACKUP_SRV_IGNORE"
alert_backup_custom_starting "${SLUG_BACKUP_SRV_FROM}" "${SLUG_BACKUP_SRV_TO_PRIMARY}"
alert_disk_ops_redundant_archive_starting "srv" "1"
archive_generic_with_rules "${SLUG_BACKUP_SRV_FROM}" "${SLUG_BACKUP_SRV_TO_PRIMARY}" "${SLUG_BACKUP_SRV_IGNORE}"
else
alert_backup_ruleset_not_defined
alert_backup_standard_starting "${SLUG_BACKUP_SRV_FROM}" "${SLUG_BACKUP_SRV_TO_PRIMARY}"
SLUG_BACKUP_SRV_IGNORE="NONE"
alert_disk_ops_redundant_archive_starting "srv" "1"
archive_generic_no_rules "${SLUG_BACKUP_SRV_FROM}" "${SLUG_BACKUP_SRV_TO_PRIMARY}"
fi
else
alert_backup_location_not_valid "${SLUG_BACKUP_SRV_TO_PRIMARY}"
fi
## _TO_SECONDARY
if [ -d "${SLUG_BACKUP_SRV_TO_SECONDARY}" ]; then
alert_disk_ops_directory_slug_located "${SLUG_BACKUP_SRV_TO_SECONDARY}"
alert_disk_ops_locate_rules
if [ -f "${SLUG_BACKUP_SRV_IGNORE}" ]; then
alert_backup_ruleset_defined "${SLUG_BACKUP_SRV_IGNORE}"
while read -r SLUG_BACKUP_LOGIC
do
alert_backup_rule_instance "${SLUG_BACKUP_LOGIC}"
done < "$SLUG_BACKUP_SRV_IGNORE"
alert_backup_custom_starting "${SLUG_BACKUP_SRV_FROM}" "${SLUG_BACKUP_SRV_TO_SECONDARY}"
alert_disk_ops_redundant_archive_starting "srv" "2"
archive_generic_with_rules "${SLUG_BACKUP_SRV_FROM}" "${SLUG_BACKUP_SRV_TO_SECONDARY}" "${SLUG_BACKUP_SRV_IGNORE}"
else
alert_backup_ruleset_not_defined
alert_backup_standard_starting "${SLUG_BACKUP_SRV_FROM}" "${SLUG_BACKUP_SRV_TO_SECONDARY}"
SLUG_BACKUP_SRV_IGNORE="NONE"
alert_disk_ops_redundant_archive_starting "srv" "2"
archive_generic_no_rules "${SLUG_BACKUP_SRV_FROM}" "${SLUG_BACKUP_SRV_TO_SECONDARY}"
fi
else
alert_backup_location_not_valid "${SLUG_BACKUP_SRV_TO_SECONDARY}"
fi
else
alert_backup_from_location_not_valid "${SLUG_BACKUP_SRV_FROM}"
fi
}
## (C004) - Backup of /usr
run_backup_usr() {
## look at /etc/fstab: Anything that's linked to the webserver and not
## needed/that's already backed up elsewhere should be excluded.
## This includes GATEWAY and SYSTEM.
if [ -z "${BACKUP_USR_TO}" ]; then
alert_backup_to_location_not_valid "${PATH_USR_TO}"
else
## Define slugs: Assuming no exclusions
SLUG_BACKUP_USR_FROM="${BACKUP_USR_FROM}"
SLUG_BACKUP_USR_TO="${BACKUP_USR_TO}"
SLUG_BACKUP_USR_IGNORE="NONE"
## Check slugs
if [ -d "${SLUG_BACKUP_USR_FROM}" ]; then
alert_disk_ops_directory_generic_from "${SLUG_BACKUP_USR_FROM}"
if [ -d "${SLUG_BACKUP_USR_TO}" ]; then
alert_disk_ops_directory_slug_located "${SLUG_BACKUP_USR_TO}"
alert_disk_ops_locate_rules
if [ "${SLUG_BACKUP_USR_IGNORE}" = "NONE" ]; then
alert_backup_ruleset_not_defined
alert_backup_custom_starting "${SLUG_BACKUP_USR_FROM}" "${SLUG_BACKUP_USR_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_USR_FROM}"
archive_generic_no_rules "${SLUG_BACKUP_USR_FROM}" "${SLUG_BACKUP_USR_TO}" "${SLUG_BACKUP_USR_IGNORE}"
else
alert_backup_ruleset_defined "${SLUG_BACKUP_USR_IGNORE}"
alert_backup_custom_starting "${SLUG_BACKUP_USR_FROM}" "${SLUG_BACKUP_USR_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_USR_FROM}"
archive_generic_with_rules "${SLUG_BACKUP_USR_FROM}" "${SLUG_BACKUP_USR_TO}" "${SLUG_BACKUP_USR_IGNORE}"
fi
else
alert_backup_location_not_valid "${SLUG_BACKUP_USR_TO}"
fi
else
alert_backup_from_location_not_valid "${SLUG_BACKUP_USR_FROM}"
fi
fi
}
## (C005) - Backup of /var
run_backup_var() {
if [ -z "${BACKUP_VAR_TO}" ]; then
alert_backup_to_location_not_valid "${PATH_VAR_TO}"
else
## Define slugs: Assuming no exclusions
SLUG_BACKUP_VAR_FROM="${BACKUP_VAR_FROM}"
SLUG_BACKUP_VAR_TO="${BACKUP_VAR_TO}"
SLUG_BACKUP_VAR_IGNORE="${BACKUP_VAR_IGNORE}"
## Check slugs
if [ -d "${SLUG_BACKUP_VAR_FROM}" ]; then
alert_disk_ops_directory_generic_from "${SLUG_BACKUP_VAR_FROM}"
if [ -d "${SLUG_BACKUP_VAR_TO}" ]; then
alert_disk_ops_directory_slug_located "${SLUG_BACKUP_VAR_TO}"
alert_disk_ops_locate_rules
if [ "${SLUG_BACKUP_VAR_IGNORE}" = "NONE" ]; then
alert_backup_ruleset_not_defined
alert_backup_custom_starting "${SLUG_BACKUP_VAR_FROM}" "${SLUG_BACKUP_VAR_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_VAR_FROM}"
archive_generic_no_rules "${SLUG_BACKUP_VAR_FROM}" "${SLUG_BACKUP_VAR_TO}"
else
alert_backup_ruleset_defined "${SLUG_BACKUP_VAR_IGNORE}"
alert_backup_standard_starting "${SLUG_BACKUP_VAR_FROM}" "${SLUG_BACKUP_VAR_TO}"
alert_disk_ops_initialized_partial "${SLUG_BACKUP_VAR_FROM}"
archive_generic_with_rules "${SLUG_BACKUP_VAR_FROM}" "${SLUG_BACKUP_VAR_TO}" "${SLUG_BACKUP_VAR_IGNORE}"
fi
else
alert_backup_location_not_valid "${SLUG_BACKUP_VAR_TO}"
fi
else
alert_backup_from_location_not_valid "${SLUG_BACKUP_VAR_FROM}"
fi
fi
}
###############################################################################
## FAILURES
###############################################################################
## ... list any failures here
###############################################################################
## DEPRECATED:
###############################################################################
## ... list any devices that are set for removal here
###############################################################################
## Default routine
###############################################################################
## (A000) - Create a redundant backup when all of your ARCHIVE drives are
## mounted. MAIN BACKUP 1=> MAIN BAKCUP 2=> MAIN BACKUP 3
run_ARCHIVE_ALL() {
printf "CHAINED ARCHIVE: disk_ops_id.dugout Chained archives are disabled by default\n"
printf "ARCHIVE: Chained archive starting now.\n"
printf "You are starting your chained ARCHVIE_ALL backup now.\n"
printf "You are initializing the chained archive macro now, runngin...\n"
printf "###################################\n"
printf "## Starting chained archiving\n"
printf "###################################\n"
## Run C001-> CN first
printf "%s: %s\n" "C001" "run_backup_etc"
run_backup_etc
printf "%s: %s\n" "C002" "run_backup_home"
run_backup_home
printf "%s: %s\n" "C002A" "run_home_archive_special"
run_home_archive_special
printf "%s: %s\n" "C003" "run_backup_srv"
run_backup_srv
printf "%s: %s\n" "C004" "run_backup_usr"
run_backup_usr
printf "%s: %s\n" "C005" "run_backup_var"
run_backup_var
## Run last in the chain
printf "%s: %s\n" "A001" "run_backup_NOVA"
run_backup_NOVA
}