From 0a3b0187c20346936c7463a30f08424e10a100d4 Mon Sep 17 00:00:00 2001 From: framp Date: Sun, 13 Jan 2019 10:47:39 +0100 Subject: [PATCH] Updated extension for 0.6.4.1 --- extensions/raspiBackupSampleExtensions.tgz | Bin 30720 -> 3403 bytes extensions/raspiBackup_disk_post.sh | 48 ++++++++++----------- extensions/raspiBackup_disk_pre.sh | 12 ++++-- extensions/raspiBackup_execute_post.sh | 4 +- extensions/raspiBackup_fstab_ready.sh | 26 ++++++++--- extensions/raspiBackup_mail.sh | 5 ++- extensions/raspiBackup_mem_post.sh | 10 ++--- extensions/raspiBackup_mem_pre.sh | 13 ++++-- extensions/raspiBackup_temp_post.sh | 7 +-- extensions/raspiBackup_temp_pre.sh | 28 +++++++++--- extensions/testExtensions.sh | 40 +++++++++++++++++ 11 files changed, 136 insertions(+), 57 deletions(-) create mode 100755 extensions/testExtensions.sh diff --git a/extensions/raspiBackupSampleExtensions.tgz b/extensions/raspiBackupSampleExtensions.tgz index 568b7ae614379a97e9ac67c8b73d93afbddb571f..3b600b78e2312974d0bdb15e2884d170ccf7fa08 100644 GIT binary patch literal 3403 zcmV-R4YcwfiwFR?2|HW>1MOVva@)2N&R_8GBc8b+ft@Nx|s_yRWJcHtW3UL$p z+*4hEXAbk2drP@h`A?KGKNJRrRT!vztYp?h3jPBf%|9Mc~e77T3{+{iNXBphg} zX)+zuAr1tnFc4WVG%SOUnJ%~-`IhDxwzUU`26s&L8px)>=jw=oYU!{6_As8Nja3W( z3>da3OGx&Txs;4C7<-;MmZZ#c`ytaY~_)he5!J>Ku_Ay+95)vXQmu_vgS2 z%y;2}xg6i261Ebsd=9oN*=%7Kp!_b_4%OU7p|8PIy{K~jre27Y)p5`T`?2kyT4Usi zie4I~iN=P;$A-T7Tr$Dp@O!KO=G|!@8Yl1J_eQtdIO)It8H;;k8*|wOlgtd9BnI+E z<-X4k}!~WEnry3@o>i-^xnWKoN4rBF#;c#orxS&Z28d}-vfs|}i)3!!J zTPz;+C`#BG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4S;?Bsc7sBt=K^VHwfaZVzxjq7CZF`Q@~*A_tXS#>VJy|0PoTN zip4F&|CF{$#jSFoSS_pjf3~&%@AsVdr0%r-CvDhZzz4?vjBf%?Uj)P#Z%n*_6K8-K zVIvz{tTL$L!Q&{ODul`df_xr%hsgcchs?P@BwqG&poKiHzRh2B<+aQg-M(/dev/null; then writeToConsole $MSG_LEVEL_MINIMAL $MSG_EXT_DISK_USAGE4 else - [[ -n ${ext_diskUsage_pre[2]} ]] && usagePre=$( bc <<< "${ext_diskUsage_pre[2]} * 1024" ) || usagePre=0 - [[ -n ${ext_diskUsage_post[2]} ]] && usagePost=$( bc <<< "${ext_diskUsage_post[2]} * 1024" ) || usagePost=0 - [[ -n ${ext_diskUsage_pre[3]} ]] && freePre=$( bc <<< "${ext_diskUsage_pre[3]} * 1024" ) || freePre=0 - [[ -n ${ext_diskUsage_post[3]} ]] && freePost=$( bc <<< "${ext_diskUsage_post[3]} * 1024" ) || freePost=0 - [[ -n ${ext_diskUsage_pre[4]} ]] && percentUsedPre=${ext_diskUsage_pre[4]} || percentUsedPre=0 - [[ -n ${ext_diskUsage_post[4]} ]] && percentUsedPost=${ext_diskUsage_post[4]} || percentUsedPost=0 +# Filesystem 1K-blocks Used Available Use% Mounted on +# /dev/root 15122316 6400128 7930972 45% / + + usagePre=$( bc <<< "${ext_diskUsage_pre[2]} * 1024" ) + usagePost=$( bc <<< "${ext_diskUsage_post[2]} * 1024" ) + freePre=$( bc <<< "${ext_diskUsage_pre[3]} * 1024" ) + freePost=$( bc <<< "${ext_diskUsage_post[3]} * 1024" ) + percentUsedPre=${ext_diskUsage_pre[4]} + percentUsedPost=${ext_diskUsage_post[4]} freeChange=$( bc <<< "$freePost - $freePre" ) - if (( $freePre == 0 )); then - writeToConsole $MSG_LEVEL_MINIMAL $MSG_EXT_DISK_USAGE4 - else + # Use bytesToHuman from raspiBackup which displays a number in a human readable form + writeToConsole $MSG_LEVEL_MINIMAL $MSG_EXT_DISK_USAGE "$(bytesToHuman $usagePre)" "$(bytesToHuman $freePre)" + writeToConsole $MSG_LEVEL_MINIMAL $MSG_EXT_DISK_USAGE2 "$(bytesToHuman $usagePost)" "$(bytesToHuman $freePost)" + if (( $freePre != 0 )); then freeChangePercent=$( printf "%3.2f" $(bc <<<"( $freePost - $freePre ) * 100 / $freePre") ) - - # Use bytesToHuman from raspiBackup which displays a number in a human readable form - writeToConsole $MSG_LEVEL_MINIMAL $MSG_EXT_DISK_USAGE "$(bytesToHuman $usagePre)" "$(bytesToHuman $freePre)" - writeToConsole $MSG_LEVEL_MINIMAL $MSG_EXT_DISK_USAGE2 "$(bytesToHuman $usagePost)" "$(bytesToHuman $freePost)" writeToConsole $MSG_LEVEL_MINIMAL $MSG_EXT_DISK_USAGE3 "$(bytesToHuman $freeChange)" "$freeChangePercent" fi fi diff --git a/extensions/raspiBackup_disk_pre.sh b/extensions/raspiBackup_disk_pre.sh index 2b7ce5bf..64411382 100755 --- a/extensions/raspiBackup_disk_pre.sh +++ b/extensions/raspiBackup_disk_pre.sh @@ -1,11 +1,12 @@ #!/bin/bash +####################################################################################################################### # -# Plugin for raspiBackup.sh +# Sample plugin for raspiBackup.sh # called before a backup is started # # Function: Display disk usage and % of disk usage change before and after backup # -# See http://www.linux-tips-and-tricks.de/raspiBackup for additional information +# See http://www.linux-tips-and-tricks.de/raspiBackup for additional information # ####################################################################################################################### # @@ -26,11 +27,14 @@ # ####################################################################################################################### -# define functions needed +# define functions needed # use local for all variables used so the script namespace is not poluted +# Filesystem 1K-blocks Used Available Use% Mounted on +# /dev/root 15122316 6400128 7930972 45% / + function getDiskUsage() { - local diskUsage=$(df $BACKUPPATH | grep "/dev") + local diskUsage=$(df $BACKUPPATH | tail -n+2) echo "$(echo $diskUsage)" } diff --git a/extensions/raspiBackup_execute_post.sh b/extensions/raspiBackup_execute_post.sh index 67291bdd..94834dbd 100755 --- a/extensions/raspiBackup_execute_post.sh +++ b/extensions/raspiBackup_execute_post.sh @@ -1,7 +1,7 @@ #!/bin/bash - +####################################################################################################################### # -# Plugin for raspiBackup.sh +# Sample plugin for raspiBackup.sh # called after a backup finished # # Function: Call another script diff --git a/extensions/raspiBackup_fstab_ready.sh b/extensions/raspiBackup_fstab_ready.sh index e3dce111..1d7f2d80 100755 --- a/extensions/raspiBackup_fstab_ready.sh +++ b/extensions/raspiBackup_fstab_ready.sh @@ -1,20 +1,36 @@ #!/bin/bash - +####################################################################################################################### # -# extensionpoint for raspiBackup.sh +# Sample plugin for raspiBackup.sh # called before dd, tar or rsync backup is started # # Function: Copy /etc/fstab into backupdirectory # # See http://www.linux-tips-and-tricks.de/raspiBackup for additional information # -# (C) 201i7 - framp at linux-tips-and-tricks dot de +####################################################################################################################### +# +# Copyright (C) 2017 framp at linux-tips-and-tricks dot de +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see .# # +####################################################################################################################### # set any messages and prefix message name with ext_ and some unique prefix to use a different namespace than the script MSG_EXT_FSTAB_COPY="ext_fstab_copy" -MSG_EN[$MSG_EXT_FSTAB_COPY]="--- RBK1005I: Copy %s to %s" -MSG_DE[$MSG_EXT_FSTAB_COPY]="--- RBK1005I: Kopiere %s in %s" +MSG_EN[$MSG_EXT_FSTAB_COPY]="RBK1005I: Copy %s to %s" +MSG_DE[$MSG_EXT_FSTAB_COPY]="RBK1005I: Kopiere %s in %s" FSTAB_FILENAME="/etc/fstab" FSTAB_TARGET_DIR="raspiBackup/extensionSaveArea" diff --git a/extensions/raspiBackup_mail.sh b/extensions/raspiBackup_mail.sh index 4c4182a9..4b04c6ab 100755 --- a/extensions/raspiBackup_mail.sh +++ b/extensions/raspiBackup_mail.sh @@ -1,12 +1,13 @@ #!/bin/bash +####################################################################################################################### # -# Sample implementation for email plugin for raspiBackup.sh +# Sample email plugin for raspiBackup.sh # # Function: Send success/failure email # # Enable with 'mailext' as parameter to -s # -# See http://www.linux-tips-and-tricks.de/raspiBackup for additional information +# See http://www.linux-tips-and-tricks.de/raspiBackup for additional information # ####################################################################################################################### # diff --git a/extensions/raspiBackup_mem_post.sh b/extensions/raspiBackup_mem_post.sh index 4f74bdf6..e5289e0a 100755 --- a/extensions/raspiBackup_mem_post.sh +++ b/extensions/raspiBackup_mem_post.sh @@ -1,6 +1,7 @@ #!/bin/bash +####################################################################################################################### # -# Plugin for raspiBackup.sh +# Sample plugin for raspiBackup.sh # called after a backup finished # # Function: Display memory free and used in MB @@ -31,13 +32,10 @@ ext_freememory_post=( $(getMemoryFree) ) # set any messages and prefix message name with ext_ and some unique prefix to use a different namespace than the script MSG_EXT_DISK_FREE="ext_freememory_1" -MSG_EN[$MSG_EXT_DISK_FREE]="--- RBK1001I: Memory usage - Pre backup - Used: %s MB Free: %s MB - Post backup - Used: %s MB Free: %s MB" -MSG_DE[$MSG_EXT_DISK_FREE]="--- RBK1001I: Speicherauslastung - Vor dem Backup - Belegt: %s MB Frei: %s MB - Nach dem Backup: Belegt: %s MB Frei: %s MB" +MSG_EN[$MSG_EXT_DISK_FREE]="RBK1001I: Memory usage - Pre backup - Used: %s MB Free: %s MB - Post backup - Used: %s MB Free: %s MB" +MSG_DE[$MSG_EXT_DISK_FREE]="RBK1001I: Speicherauslastung - Vor dem Backup - Belegt: %s MB Frei: %s MB - Nach dem Backup: Belegt: %s MB Frei: %s MB" # now write message to console and log and email # $MSG_LEVEL_MINIMAL will write message all the time # $MSG_LEVEL_DETAILED will write message only if -m 1 parameter was used writeToConsole $MSG_LEVEL_MINIMAL $MSG_EXT_DISK_FREE "${ext_freememory_pre[0]}" "${ext_freememory_pre[1]}" "${ext_freememory_post[0]}" "${ext_freememory_post[1]}" - - - diff --git a/extensions/raspiBackup_mem_pre.sh b/extensions/raspiBackup_mem_pre.sh index 25fff81d..5dd390b8 100755 --- a/extensions/raspiBackup_mem_pre.sh +++ b/extensions/raspiBackup_mem_pre.sh @@ -1,6 +1,7 @@ #!/bin/bash +####################################################################################################################### # -# Plugin for raspiBackup.sh +# Sample plugin for raspiBackup.sh # called before a backup is started # # Function: Display memory free and used in MB @@ -29,11 +30,15 @@ # define functions needed # use local for all variables used so the script namespace is not poluted +# total used free shared buff/cache available +#Mem: 481 55 34 8 391 353 +#Swap: 99 83 16 + function getMemoryFree() { - local temp=$(free -m | grep "^-" | cut -d ':' -f 2) - echo "$(echo $temp)" + eval set -- "$(free -m |grep -i 'Mem:')" + echo "$3 $4" } -# set any variables and prefix all names with ext_ and some unique prefix to use a different namespace than the script ext_freememory_pre=( $(getMemoryFree) ) +# set any variables and prefix all names with ext_ and some unique prefix to use a different namespace than the script diff --git a/extensions/raspiBackup_temp_post.sh b/extensions/raspiBackup_temp_post.sh index 17ba3349..bfa63937 100755 --- a/extensions/raspiBackup_temp_post.sh +++ b/extensions/raspiBackup_temp_post.sh @@ -1,6 +1,7 @@ #!/bin/bash +####################################################################################################################### # -# Plugin for raspiBackup.sh +# Sample plugin for raspiBackup.sh # called after a backup finished # # Function: Display CPU temperature @@ -31,8 +32,8 @@ ext_CPUTemp_post=$(getCPUTemp) # set any messages and prefix message name with ext_ and some unique prefix to use a different namespace than the script MSG_EXT_CPU_TEMPERATURE="ext_CPUTemp_1" -MSG_EN[$MSG_EXT_CPU_TEMPERATURE]="--- RBK1000I: CPU temperature pre and post backup: %s - %s" -MSG_DE[$MSG_EXT_CPU_TEMPERATURE]="--- RBK1000I: CPU Temperatur vor und nach dem Backup: %s - %s" +MSG_EN[$MSG_EXT_CPU_TEMPERATURE]="RBK1000I: CPU temperature pre and post backup: %s - %s" +MSG_DE[$MSG_EXT_CPU_TEMPERATURE]="RBK1000I: CPU Temperatur vor und nach dem Backup: %s - %s" # now write message to console and log and email # $MSG_LEVEL_MINIMAL will write message all the time diff --git a/extensions/raspiBackup_temp_pre.sh b/extensions/raspiBackup_temp_pre.sh index 665fe5c9..da466d5f 100755 --- a/extensions/raspiBackup_temp_pre.sh +++ b/extensions/raspiBackup_temp_pre.sh @@ -1,17 +1,33 @@ #!/bin/bash - +######################################################################################################################## # -# extensionpoint for raspiBackup.sh +# Sample plugin for raspiBackup.sh # called before a backup is started -# +# # Function: Display CPU temperature # -# See http://www.linux-tips-and-tricks.de/raspiBackup for additional information +# See http://www.linux-tips-and-tricks.de/raspiBackup for additional information +# +####################################################################################################################### +# +# Copyright (C) 2015 framp at linux-tips-and-tricks dot de +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# (C) 2015 - framp at linux-tips-and-tricks dot de +# You should have received a copy of the GNU General Public License +# along with this program. If not, see .# # +####################################################################################################################### -# define functions needed +# define functions needed # use local for all variables so the script namespace is not polluted function getCPUTemp() { diff --git a/extensions/testExtensions.sh b/extensions/testExtensions.sh new file mode 100755 index 00000000..d1b11d42 --- /dev/null +++ b/extensions/testExtensions.sh @@ -0,0 +1,40 @@ +#!/bin/bash +######################################################################################################################## +# +# Function: Invoke all sample plugins. Helps to debug and develop plugins +# +# See http://www.linux-tips-and-tricks.de/raspiBackup for additional information +# +######################################################################################################################## +# +# Copyright (C) 2018 framp at linux-tips-and-tricks dot de +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see .# +# +####################################################################################################################### + +if [[ -f ../raspiBackup.sh ]]; then + . ../raspiBackup.sh --include +else + . raspiBackup.sh --include +fi + +. raspiBackup_disk_pre.sh +. raspiBackup_disk_post.sh + +. raspiBackup_mem_pre.sh +. raspiBackup_mem_post.sh + +. raspiBackup_temp_pre.sh +. raspiBackup_temp_post.sh