Compare commits
No commits in common. "b5e9afe5a48d931da3b0f424acf7cdf8c3fc59bf" and "a05cbf9a6f8ee9dd758fe1d4b36763c310bc3c2c" have entirely different histories.
b5e9afe5a4
...
a05cbf9a6f
|
@ -20,5 +20,3 @@ woodpecker_server: 'ci.rustybever.be:9000'
|
||||||
woodpecker_secret: "{{ vault_woodpecker_secret }}"
|
woodpecker_secret: "{{ vault_woodpecker_secret }}"
|
||||||
|
|
||||||
restic_version: '0.16.2'
|
restic_version: '0.16.2'
|
||||||
|
|
||||||
ntfy_user_pi_pass: "{{ vault_ntfy_user_pi_pass }}"
|
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
35353730613932643733343565323332383038383461626535616166616338653066306533366164
|
65396664323038303134303832613939623230323365613162313835623462663137623231643466
|
||||||
6261353438653937326264623632363336633039383361620a333239333937663561613162376161
|
3661303536326134636662636237326337653535613565380a643035326434656334363432633037
|
||||||
30393966656236656634633035643336626538373733643863613864373439363564376563613361
|
31626233633935616234376334336138353833613962653632313639383932613638316238636436
|
||||||
3666616235623631370a373439393839313336323466306461373534626661616231333436326663
|
3066656463396530340a356634316630363866373834393035336663373264613031646231666538
|
||||||
37616638353830323865356236363937313033643563646466366432623762393539386334623938
|
63366666336236313236653831316433346335356430366364303739666532623835373931376636
|
||||||
63303331363165313437383061353037313536333132393439653538316264376362336466313231
|
63386434346265626331306461393330316164396632383462613537343664616266643938646632
|
||||||
66313530313937373232613534343065626534666136326233626137353631386161653133643933
|
66316362623730313039666161353232313265613463653762666533356532633333616631343235
|
||||||
37356237643362643161383131623035373037653139643331663435623162323566643635353731
|
66646339643366663365323165383830353562643266353935386334383134623933353162653666
|
||||||
62663165383465656432613339353466313437323365393766313865323565623138363537356561
|
6432
|
||||||
31623565353362356464376637386633373133333365336662346331633236383934623638366662
|
|
||||||
31326264306434633532373131303839613735343364613232306164316661313933636235633161
|
|
||||||
37346630333565313636333435323635663962376636366437383938663763366433366230376636
|
|
||||||
3431
|
|
||||||
|
|
|
@ -1,32 +1,35 @@
|
||||||
$ANSIBLE_VAULT;1.1;AES256
|
$ANSIBLE_VAULT;1.1;AES256
|
||||||
30653235356365303661373234343761643338633930316436373463633164393230663264616633
|
62346334613664653131343434626663336631396537393434353165616236306339376365656539
|
||||||
3638313463653234326466653836343437393036323839330a353033346131383734353435393839
|
6435616564373934616339363363333431313531336262350a373137646264636364333464336230
|
||||||
63396133333861623739353136386263323031613862343833623535396135366361643532363861
|
30613464636139363061376563333563383634653564623264633133613337663465653633323830
|
||||||
3830663635323936330a323663643931643234346636623930353533363166613237366538393734
|
3232343731636135340a316263363633373038393261346637623333616137303662613132623661
|
||||||
64666638383862343763636466353134646632376162643330646362306531336431383533313933
|
66363736356631316231303262356531326663333566313832346165323863376236393335363130
|
||||||
66346139346138326663396237346661626434643165656664616436366537363361393535323262
|
39393262623633646230656130316461396530646565353234663766356563326338613261313832
|
||||||
35356339323635343739353931386638373836613032343134366431353164663461636430303363
|
33373232333231333666366564396562383034353961393262646231626632396135373265303066
|
||||||
35313261316662383661353932646331663063306337663130663933663566343966306338373163
|
61613131323762363635633939666464633730376538323538313339306464643036656337393633
|
||||||
33386534313231643363373165623065353264393539316339373163626363316562373034636435
|
64386439636665366630633462623530663833326438613433306134373966393130343438323334
|
||||||
63643961623639366461323133386337643365353634663630666632376366633730616163653338
|
33366530373831326533303632373564376463643439633538653039373464386433663037346535
|
||||||
37663635623563363932663739373435316335666539393930313066666565646531393730656332
|
61326430393662353732383231663632363433333565373136633930623533343061366639333262
|
||||||
31653631363261663338336362653830356635376433666537356433323839323030626636653639
|
32613435363232346131393862663066663539323334326566356235626565333831393066343731
|
||||||
37393237613465313231396264393339653164316432376364373737633731646431386135356438
|
36356539326632666665633166363135313139646136373934613561323531393533643131333963
|
||||||
31616139633062376262396337396234303065663238326363316130323533343565343366376361
|
66613561343864353937386632376330346666626262303166353838333966366239363363656335
|
||||||
62353739653735393637353938313261653533336237393333333930656637663662643162616662
|
39393163616133316531356339623933633237393663323630386363636163636136383334343230
|
||||||
35636437393133616230373437653766393361613535353633373866383431393862623135383738
|
39326431663232303835656632373035623531656131383763323536383433343131363239343536
|
||||||
33623433396538366362633131353834353164363165356561313238653631343430656163383761
|
31643364613031386162656236373635303235303262393239396138393061313331333436663663
|
||||||
61336364653230333138363630616130623132333539353534323465663833626563343864626638
|
36613963343262346131643263373937653264626230373737643935386338343434613434663061
|
||||||
34353064626538383734303436306639666239363536313062343239656136313466343366393964
|
36396265336466306437383664653731343838396663396233393663656138363932323563326631
|
||||||
37663864346534346131643362646662316234643263306166313334626564356565353966383961
|
62363332613261383637653861346338626531353330346532303066623638376663366133313532
|
||||||
64343630396637613130643436326564383533323134323066373039303533323261656164303862
|
63623930303363333162373562323334373332346335303065643536396565626534316537376466
|
||||||
39396530343534383837383664363235613939663765616663383031643839643939313839643437
|
64663266396238653165346134363432386532323534373366643233373366316365323938313661
|
||||||
35323831633231613364356134633535396333643862343531333965366135323631323764336264
|
36346362646430623563376261306265623663326534373562636633303835333330613761326264
|
||||||
63393330613532643831623364396234613539353735633539626635393038656437316465616535
|
33353264316238663134346463333033346564653137646336373134623134633534343333366262
|
||||||
61353730623735356535313438366332633233666631643531323135323864346565613066376238
|
37646166623463323436363436386539343061646230626638313537643862316338383939316233
|
||||||
39393834633263633566343539663765656266313637303565663465663139343565643962656637
|
62333535663338346663363334386538366437393161356639306636393232396562303366383232
|
||||||
32303464353031323039346533616433613862336630313139646665323931396335306134633531
|
64313762363436333262396631663331333033356362373764373732313330396237383864316638
|
||||||
66396262353363383565643434393438633232376431616465623038656463346237373038656164
|
34306563646633366666343535346630616632343033343036393232376264653831373664356361
|
||||||
61373262626634633335323163636366336134613663643039373530373538383134323631623438
|
66333737343731393837633432383862326532336434326461313439653763613062343331646639
|
||||||
34636364653463656536336462613962386339616365373533356161633132383532303264383565
|
38376536306532623834336435353962323635383930323435376234316230636533353264626663
|
||||||
646335383665303262623363613532643738
|
38306366316534383530613131346163613765326534396231373932303639393430656233363234
|
||||||
|
63643133623637326466623765653638383437343035343035653766333036373334343961326534
|
||||||
|
32303665336130346636616564613332393235303034643939643635346662316466356535653331
|
||||||
|
3265353466356535346632623363373037303861346135613066
|
||||||
|
|
14
nas.yml
14
nas.yml
|
@ -7,13 +7,6 @@
|
||||||
- common
|
- common
|
||||||
tags: base
|
tags: base
|
||||||
|
|
||||||
- name: Configure BTRFS RAID
|
|
||||||
hosts: nas
|
|
||||||
become: yes
|
|
||||||
roles:
|
|
||||||
- raid
|
|
||||||
tags: raid
|
|
||||||
|
|
||||||
- hosts: nas
|
- hosts: nas
|
||||||
become: yes
|
become: yes
|
||||||
roles:
|
roles:
|
||||||
|
@ -21,6 +14,13 @@
|
||||||
- ntfy-server
|
- ntfy-server
|
||||||
tags: ntfy
|
tags: ntfy
|
||||||
|
|
||||||
|
- name: Configure BTRFS RAID
|
||||||
|
hosts: nas
|
||||||
|
become: yes
|
||||||
|
roles:
|
||||||
|
- raid
|
||||||
|
tags: raid
|
||||||
|
|
||||||
- name: Set up Samba
|
- name: Set up Samba
|
||||||
hosts: nas
|
hosts: nas
|
||||||
become: yes
|
become: yes
|
||||||
|
|
|
@ -8,36 +8,10 @@
|
||||||
export RESTIC_REPOSITORY='rest:http://{{ groups['nas'][0] }}:8000/backups'
|
export RESTIC_REPOSITORY='rest:http://{{ groups['nas'][0] }}:8000/backups'
|
||||||
export RESTIC_PASSWORD_FILE='/etc/backups/restic_backups_passwd'
|
export RESTIC_PASSWORD_FILE='/etc/backups/restic_backups_passwd'
|
||||||
|
|
||||||
log_file='/tmp/backup-all.sh.log'
|
|
||||||
|
|
||||||
rm -f "$log_file"
|
|
||||||
|
|
||||||
for script in $(find /etc/backups -name '*.backup.sh'); do
|
for script in $(find /etc/backups -name '*.backup.sh'); do
|
||||||
T="$(date +%s)"
|
|
||||||
|
|
||||||
/usr/bin/bash "$script"
|
/usr/bin/bash "$script"
|
||||||
|
|
||||||
res="$?"
|
|
||||||
T="$(($(date +%s)-T))"
|
|
||||||
|
|
||||||
if [[ $res == 0 ]]; then
|
|
||||||
header='OK'
|
|
||||||
else
|
|
||||||
header="FAIL ($res)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
printf \
|
|
||||||
"%s: %s in %02dh%02dm%02ds\n" \
|
|
||||||
"$(basename "$script")" "$header" \
|
|
||||||
"$((T/3600%24))" "$((T/60%60))" "$((T%60))" \
|
|
||||||
>> "$log_file"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Prune older backups
|
# Prune older backups
|
||||||
/usr/local/bin/restic forget --keep-last 7 && \
|
/usr/local/bin/restic forget --keep-last 7 && \
|
||||||
/usr/local/bin/restic prune
|
/usr/local/bin/restic prune
|
||||||
|
|
||||||
# Send status notification
|
|
||||||
ntfy publish \
|
|
||||||
--title "Backups ($(hostname))" \
|
|
||||||
homelab "$(cat "$log_file")"
|
|
||||||
|
|
Loading…
Reference in New Issue