Last active 1 month ago

Create an encrypted archive of our backup script directory

mxsr revised this gist 9 months ago. Go to revision

2 files changed, 13 insertions, 1 deletion

dump.sh(file created)

@@ -0,0 +1,12 @@
1 + #!/usr/bin/env bash
2 +
3 + docker exec -t nightscout-db-1 mongodump --quiet --archive | zstd > nightscout_database_$(date -Is).archive.zst
4 + docker exec -t gitea-db-1 pg_dumpall --clean --if-exists -U gitea | zstd > gitea_database_$(date -Is).dump.zst
5 + docker exec -t paperless-db-1 pg_dumpall --clean --if-exists -U paperless | zstd > paperless_database_$(date -Is).dump.zst
6 + docker exec -t teslamate-db-1 pg_dumpall --clean --if-exists -U teslamate | zstd > teslamate_database_$(date -Is).dump.zst
7 +
8 + # ------------------------------------
9 + # To decompress the files use zstd -d:
10 + #
11 + # zstd -d < file.dump.zst > file.dump
12 + # ------------------------------------

zip.sh

@@ -1,6 +1,6 @@
1 1 #!/usr/bin/env sh
2 2
3 3 sudo echo "sudo priveliges granted"
4 - sudo tar -I "zstd -19" -c -C /opt/backup . | age -p > backup_tasks_$(date -Is).tzst.age
4 + sudo tar -I "zstd -9" -c -C /opt/backup . | age -p > backup_tasks_$(date -Is).tzst.age
5 5
6 6 # Then use https://github.com/schollz/croc to send file to target machine.

mxsr revised this gist 9 months ago. Go to revision

1 file changed, 1 insertion, 1 deletion

zip.sh

@@ -1,6 +1,6 @@
1 1 #!/usr/bin/env sh
2 2
3 3 sudo echo "sudo priveliges granted"
4 - sudo tar -I "zstd -19" -c -C /opt/backup . | age -p > backup_tasks_$(date -Is).tar.zst.age
4 + sudo tar -I "zstd -19" -c -C /opt/backup . | age -p > backup_tasks_$(date -Is).tzst.age
5 5
6 6 # Then use https://github.com/schollz/croc to send file to target machine.

mxsr revised this gist 9 months ago. Go to revision

1 file changed, 1 insertion, 1 deletion

zip.sh

@@ -1,6 +1,6 @@
1 1 #!/usr/bin/env sh
2 2
3 3 sudo echo "sudo priveliges granted"
4 - sudo tar cz -C /opt/backup . | age -p > backup_tasks_$(date -Is).tgz.age
4 + sudo tar -I "zstd -19" -c -C /opt/backup . | age -p > backup_tasks_$(date -Is).tar.zst.age
5 5
6 6 # Then use https://github.com/schollz/croc to send file to target machine.

mxsr revised this gist 9 months ago. Go to revision

1 file changed, 1 insertion, 1 deletion

zip.sh

@@ -1,6 +1,6 @@
1 1 #!/usr/bin/env sh
2 2
3 3 sudo echo "sudo priveliges granted"
4 - sudo tar cz -C /opt/backup . | age -p > backup_tasks_$(date +%Y-%m-%d-%H%M%S).tgz.age
4 + sudo tar cz -C /opt/backup . | age -p > backup_tasks_$(date -Is).tgz.age
5 5
6 6 # Then use https://github.com/schollz/croc to send file to target machine.

mxsr revised this gist 9 months ago. Go to revision

1 file changed, 6 insertions

zip.sh(file created)

@@ -0,0 +1,6 @@
1 + #!/usr/bin/env sh
2 +
3 + sudo echo "sudo priveliges granted"
4 + sudo tar cz -C /opt/backup . | age -p > backup_tasks_$(date +%Y-%m-%d-%H%M%S).tgz.age
5 +
6 + # Then use https://github.com/schollz/croc to send file to target machine.
Newer Older