diff --git a/roles/lib/setup-restic.yml b/roles/lib/setup-restic.yml index 1b52f7f..55716b4 100644 --- a/roles/lib/setup-restic.yml +++ b/roles/lib/setup-restic.yml @@ -105,13 +105,16 @@ if $backup; then echo "Backing up... to misamisa" echo "Date: $(date '+%Y-%m-%d_%H-%M-%S')" # Add your Restic backup command here - restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) backup $backupdir + restic --password-file ./.resticpassword -r sftp:misamisa://home/restic/$(hostname) backup $backupdir \ + | tee backup.out status=$? if [ $status -eq 0 ]; then # If the exit status is 0 (success), send a success message ./discord.sh "$(hostname) backup complete" elif [ $status -eq 3 ]; then - ./discord.sh "$(hostname) backup complete" + details=$(grep -A4 "Added to the repository:"" backup.out) + >backup.out + ./discord.sh "$(hostname) backup complete $details" else # If the exit status is not 0 (failure), send a failure message ./discord.sh "$(hostname) Backup has failed"