added bwrs backup
This commit is contained in:
parent
77cb2fee06
commit
bdd32efcf1
9
bitwarden_rs-backup/README.md
Normal file
9
bitwarden_rs-backup/README.md
Normal file
@ -0,0 +1,9 @@
|
||||
## Telegram Bot API
|
||||
|
||||
TG_BOT_TOKEN=
|
||||
TG_CHATID=
|
||||
|
||||
|
||||
`crontab -e`
|
||||
|
||||
`*/15 * * * * ~/bitwarden/backupbw-tg.sh`
|
22
bitwarden_rs-backup/backup-tg.sh
Normal file
22
bitwarden_rs-backup/backup-tg.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
#edit these to your config
|
||||
TG_BOT_TOKEN=''
|
||||
TG_CHATID=''
|
||||
BWDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
|
||||
|
||||
TG_BOTAPI=https://api.telegram.org/bot
|
||||
DATETIME="$(date +'%d-%m-%Y_%H-%M-%S')"
|
||||
GZFILE=bitwarden-${DATETIME}.tar.gz
|
||||
|
||||
#change working dir to /tmp
|
||||
cd /tmp/
|
||||
|
||||
#compress bitwarden directory to gzfile
|
||||
tar -Pczf $GZFILE $BWDIR
|
||||
|
||||
#update to telgeram
|
||||
curl -s -F document=@$GZFILE $TG_BOTAPI$TG_BOT_TOKEN/sendDocument?chat_id=$TG_CHATID > /dev/null
|
||||
|
||||
#remove temp file
|
||||
#rm $GZFILE
|
Loading…
x
Reference in New Issue
Block a user