fist working backup script
This commit is contained in:
44
restic/files/backup.sh.jinja
Normal file
44
restic/files/backup.sh.jinja
Normal file
@@ -0,0 +1,44 @@
|
||||
#!/bin/bash
|
||||
{%- if pillar.restic.repository is defined %}
|
||||
export RESTIC_REPOSITORY={{ pillar.restic.mount }}{{ pillar.restic.suffix }}
|
||||
{%- else %}
|
||||
export RESTIC_REPOSITORY="stfp:{{ pillar.restic.user }}@{{ pillar.restic.host }}:{{ pillar.restic.mount }}{{ pillar.restic.suffix }}"
|
||||
{%- endif %}
|
||||
export RESTIC_PASSWORD={{ pillar.restic.password }}
|
||||
|
||||
restic backup \
|
||||
--exclude="*.tmp" \
|
||||
--exclude="lost+found" \
|
||||
--exclude="Cache" \
|
||||
--exclude="cache" \
|
||||
--exclude=".cache" \
|
||||
--exclude="tmp" \
|
||||
--exclude="temp" \
|
||||
--exclude="Temp" \
|
||||
--exclude="/home/*/go" \
|
||||
--exclude="/home/*/.local/share/virtualenv" \
|
||||
--exclude="/home/*/.local/share/virtualenvs" \
|
||||
--exclude="/home/*/VirtualBox VMs" \
|
||||
--exclude="/home/*/.mozillla/firefox/*/minidumps" \
|
||||
--exclude="/home/*/.mozillla/firefox/*/storage" \
|
||||
--exclude="/home/*/.mozillla/firefox/*/extensions.sqlite" \
|
||||
--exclude="/home/*/.mozillla/firefox/*/urlclassifier3.sqlite" \
|
||||
--exclude="/home/*/.config/google-chrome/*/Local Storage" \
|
||||
--exclude="/home/*/.config/google-chrome/*/Session Storage" \
|
||||
--exclude="/home/*/.config/google-chrome/*/Application Cache" \
|
||||
--exclude="/home/*/.config/google-chrome/*/History" \
|
||||
--exclude="/home/*/.config/google-chrome/*/History-journal" \
|
||||
--exclude="/home/*/.config/google-chrome/*/History Provider Cache" \
|
||||
--exclude="/home/*/.local/share/flatpak" \
|
||||
--exclude="/home/*/.var/app/com.slack.Slack" \
|
||||
--exclude="/home/*/.local/share/Trash" \
|
||||
--exclude="/home/*/.config/Microsoft/Microsoft Teams" \
|
||||
--exclude="/home/*/.wine" \
|
||||
--exclude="/home/*/.vim/bundle" \
|
||||
--exclude="/home/*/snap" \
|
||||
--exclude="/home/*/Downloads" \
|
||||
--exclude="/home/*/Nextcloud" \
|
||||
--exclude="/home/*/git" \
|
||||
--verbose \
|
||||
{% if pillar.podman is defined %}{{ salt['cmd.run']('podman info -f "{{.Store.VolumePath}}"', runas=pillar.podman.user ) }} \{% endif %}
|
||||
/home
|
@@ -2,7 +2,7 @@
|
||||
Description=Automount for restic repository
|
||||
|
||||
[Automount]
|
||||
Where={{ pillar['restic']['repository']['mount'] }}
|
||||
Where={{ pillar['restic']['mount'] }}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
@@ -3,7 +3,7 @@ Description=Mount the USB disk used as restic repository
|
||||
|
||||
[Mount]
|
||||
What=/dev/disk/by-uuid/{{ pillar['restic']['repository']['disk_uuid'] }}
|
||||
Where={{ pillar['restic']['repository']['mount'] }}
|
||||
Where={{ pillar['restic']['mount'] }}
|
||||
Type=auto
|
||||
Options=defaults
|
||||
|
||||
|
Reference in New Issue
Block a user