Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#16: execute opt-deps only if they are present #17

Merged
merged 1 commit into from
Apr 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions templates/borg-backup.sh.epp
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,27 @@ pre_backup() {
# save some data that's useful for restores
local backupDataDir=/root/backup-data/
mkdir -p "$backupDataDir"
fdisk -l > "$backupDataDir/fdisk"
vgdisplay > "$backupDataDir/vgdisplay"
pvdisplay > "$backupDataDir/pvdisplay"
lvdisplay > "$backupDataDir/lvdisplay"
df -a > "$backupDataDir/df"
findmnt -l > "$backupDataDir/findmnt"
if [ $(command -v fdisk) ]; then
fdisk -l > "$backupDataDir/fdisk"
fi
if [ $(command -v vgdisplay) ]; then
vgdisplay > "$backupDataDir/vgdisplay"
fi
if [ $(command -v pvdisplay) ]; then
pvdisplay > "$backupDataDir/pvdisplay"
fi
if [ $(command -v lvdisplay) ]; then
lvdisplay > "$backupDataDir/lvdisplay"
fi
if [ $(command -v df) ]; then
df -a > "$backupDataDir/df"
fi
if [ $(command -v findmnt) ]; then
findmnt -l > "$backupDataDir/findmnt"
fi
if [ $(command -v mdadm) ]; then
mdadm --detail --scan > "$backupDataDir/mdadm"
fi

# If you wish to use snapshots, create them here

Expand Down