15 lines
377 B
Bash
15 lines
377 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
# adapt to your needs
|
||
|
# this serves as an example and assumes configured mailx
|
||
|
|
||
|
SNAPSHOTS=$(/usr/bin/restic snapshots -c)
|
||
|
STATS=$(/usr/bin/restic stats)
|
||
|
|
||
|
# output for stdin (service)
|
||
|
echo -e "$STATS\n\n$SNAPSHOTS"
|
||
|
|
||
|
# output for mail
|
||
|
me="$0"
|
||
|
echo -e "$STATS\n\n$SNAPSHOTS" | mailx -Ssendwait -s "[restic - $(hostname)] $me - REPORT" "${RESTIC_REPORT_MAIL}"
|