-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackup.sh
More file actions
9 lines (9 loc) · 815 Bytes
/
backup.sh
File metadata and controls
9 lines (9 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
#!/bin/bash
currentdate=$(date +"%d-%m-%Y-%H-%M-%S")
export_path=/mnt/backup/backup-$currentdate.csv
# Ändern Sie in der nächsten Zeile den Wert <Benutzername> zu Ihrer E-Mail-Adresse und den Wert <Passwort> zu dem zugehörigen Passwort Ihres HomeBox-Accounts.
token=$(curl -s --request POST --url http://localhost:3100/api/v1/users/login --header 'Accept: application/json' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode password=<Passwort> --data-urlencode stayLoggedIn=true --data-urlencode username=<Benutzername>)
token=${token:10:-94}
echo "Erstelltes Zugriffstoken: $token."
curl -s --request GET --url http://localhost:3100/api/v1/items/export --header 'Accept: */*' --header "Authorization: ${token}" > $export_path
echo "Itemliste erfolgreich nach $export_path exportiert."