12345678910111213141516171819 |
- #!/usr/bin/env zsh
- (( ${#} < 1 )) && { echo 'Device name is required'; exit 1 }
- local devdir="${HOME}/nextcloud/KeePassXC/${1}"
- if ! [ -d "${devdir}" ]; then
- mkdir "${devdir}" || exit 1
- fi
- find "${devdir}" -depth -mtime +30 -delete
- local datetime="$(date +'d%d-%m-%Y_t%H-%M-%S')"
- local filename="keepassxc-db-backup-${datetime}.tar.gz"
- tar -caf \
- "${devdir}/${filename}" \
- "${HOME}/.keepassxc"
|