mirror of
https://github.com/octoleo/Purse.git
synced 2024-12-28 03:45:04 +00:00
Include script in backup archive
This commit is contained in:
parent
883e68a95f
commit
7074a8bf4c
6
purse.sh
6
purse.sh
@ -17,6 +17,7 @@ gpgconf="${HOME}/.gnupg/gpg.conf"
|
||||
backuptar="${PURSE_BACKUP:=purse.$(hostname).$(date +%F).tar}"
|
||||
safeix="${PURSE_INDEX:=purse.index}"
|
||||
safedir="${PURSE_SAFE:=safe}"
|
||||
script="$(basename $BASH_SOURCE)"
|
||||
timeout=10
|
||||
|
||||
fail () {
|
||||
@ -155,11 +156,12 @@ list_entry () {
|
||||
}
|
||||
|
||||
backup () {
|
||||
# Archive encrypted index and safe directory.
|
||||
# Create an archive for backup.
|
||||
|
||||
if [[ -f "${safeix}" ]] ; then
|
||||
cp "${gpgconf}" "gpg.conf.${now}"
|
||||
tar cfv "${backuptar}" "${safeix}" "${safedir}" "gpg.conf.${now}"
|
||||
tar cfv "${backuptar}" \
|
||||
"${safeix}" "${safedir}" "gpg.conf.${now}" "${script}"
|
||||
rm "gpg.conf.${now}"
|
||||
else fail "Nothing to archive" ; fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user