Skip to content

Instantly share code, notes, and snippets.

View Theprim0's full-sized avatar
🎯
Focusing

Ark Prim0 Theprim0

🎯
Focusing
View GitHub Profile
@Theprim0
Theprim0 / mongo_bpipe.sh
Created November 12, 2021 11:58 — forked from ba0f3/mongo_bpipe.sh
backup mongodb using BareOS' bpipe plugin
#!/bin/sh
# Save this file on the on FD
# /usr/lib/bareos/plugins/mongo_bpipe.sh
#DBNAMES=""
#DBUSERNAME=""
#DBPASSWORD=""
#DBAUTHDB=""
hola=$(for d in /tmp/bareos-restores/_percona/250/*/xtrabackup_info; do
printf '%s\t%s\n' "$(grep start_time "$d")" "$(basename "$(dirname "$d")")"
done | sort | cut -f2-)
for a in $hola; do
array=("${array[@]}" "$a")
done
echo ${array[@]}