-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from nrsyed/dev/archival
Archival scripts
- Loading branch information
Showing
4 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |