Skip to content

Commit

Permalink
Merge pull request #2 from nrsyed/dev/archival
Browse files Browse the repository at this point in the history
Archival scripts
  • Loading branch information
nrsyed authored Apr 14, 2022
2 parents ee3681d + 85d2167 commit a0660b2
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/archival/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Archival scripts

This directory contains scripts used to tar and (gpg) encrypt files for
cloud backup.
17 changes: 17 additions & 0 deletions scripts/archival/photo_albums.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

root=/mnt/win/Users/nsyed/Documents/pdf_scans/photo_albums

read -s -p "gpg password: " password
echo

for group_dir in $(ls $root); do
group_dirpath="$root/$group_dir"

[ -d $group_dir ] || mkdir $group_dir

for album_dir in $(ls $group_dirpath); do
dst_path="$group_dir/$album_dir.tar.gpg"
tar -C "$group_dirpath" -cvf - $album_dir | gpg -c --batch --passphrase "$password" > "$dst_path"
done
done
6 changes: 6 additions & 0 deletions scripts/archival/scanned_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

root=/mnt/win/Users/nsyed/Documents/pdf_scans/scanned_docs
dst=scanned_docs.tar.gz.gpg

tar -C "$root" -czvf - . | gpg -c > "$dst"
19 changes: 19 additions & 0 deletions scripts/archival/storage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

dirs="asus_n55s kw my_old_dell_inspiron_e1705 old_60gb_hdd old_pictures dione old_10gb_hdd old_dell_inspiron_e1705 s10_plus videos"

#tar -czvf - $dirs | gpg -c > storage.tar.gz.gpg
#export GPG_TTY=$(tty)
# NOTE: If gpg command times out, try adding `pinentry-timeout 0`
# to ~/.gnupg/gpg-agent.conf. Also run `gpgconf --kill gpg-agent` to kill
# currently running agent.

read -s -p "gpg password: " password
echo

tmp=storage.tar.pgz
dst=storage.tar.pgz.gpg

tar -I pigz -cvf $tmp $dirs
gpg -c --batch --passphrase "$password" > $dst
rm $tmp

0 comments on commit a0660b2

Please sign in to comment.