mirror of
https://github.com/octoleo/Purse.git
synced 2024-12-29 12:32:39 +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}"
|
backuptar="${PURSE_BACKUP:=purse.$(hostname).$(date +%F).tar}"
|
||||||
safeix="${PURSE_INDEX:=purse.index}"
|
safeix="${PURSE_INDEX:=purse.index}"
|
||||||
safedir="${PURSE_SAFE:=safe}"
|
safedir="${PURSE_SAFE:=safe}"
|
||||||
|
script="$(basename $BASH_SOURCE)"
|
||||||
timeout=10
|
timeout=10
|
||||||
|
|
||||||
fail () {
|
fail () {
|
||||||
@ -155,11 +156,12 @@ list_entry () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
backup () {
|
backup () {
|
||||||
# Archive encrypted index and safe directory.
|
# Create an archive for backup.
|
||||||
|
|
||||||
if [[ -f "${safeix}" ]] ; then
|
if [[ -f "${safeix}" ]] ; then
|
||||||
cp "${gpgconf}" "gpg.conf.${now}"
|
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}"
|
rm "gpg.conf.${now}"
|
||||||
else fail "Nothing to archive" ; fi
|
else fail "Nothing to archive" ; fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user