Compare commits
No commits in common. "e495b65b24fbf77820806b795779caa696e046f1" and "5dff2a691991c991c18b633dbaffb3d8d07c88bd" have entirely different histories.
e495b65b24
...
5dff2a6919
16
pilerBackup/pilerbackup.sh
Executable file → Normal file
16
pilerBackup/pilerbackup.sh
Executable file → Normal file
@ -322,17 +322,6 @@ done
|
||||
|
||||
|
||||
### check pre-requisites and default values
|
||||
# check if running as root, otherwise exit
|
||||
if [ $( id -u ) -ne 0 ]; then
|
||||
printf "\n${err}ERROR: script MUST be run as ROOT${norm}\n\n"
|
||||
exit 2
|
||||
fi
|
||||
# find pilerexport, otherwise this is all pointless
|
||||
pilerExport=$( command -v pilerexport )
|
||||
if [ ! "$pilerExport" ]; then
|
||||
printf "\n${err}ERROR: cannot find 'pilerexport'${norm}\n\n"
|
||||
exit 4
|
||||
fi
|
||||
# does the details file exist?
|
||||
if [ ! -f "$configDetails" ]; then
|
||||
badParam dne "(--details default)" "$configDetails"
|
||||
@ -415,13 +404,13 @@ printf "\n${yellow}%s/${cyan} --${norm}\n" "$exportDir" >> "$logFile"
|
||||
printf "${cyan}[%s] -- [INFO] Exporting EML files from piler --${norm}\n" \
|
||||
"$(stamp)" >> "$logFile"
|
||||
if [ "$exportAll" -eq 1 ]; then
|
||||
if ! ${pilerExport} -A 2>>"$logFile"; then
|
||||
if ! pilerexport -A 2>>"$logFile"; then
|
||||
exitError 115 "There was a problem while exporting EML from piler"
|
||||
fi
|
||||
printf "${ok}[%s] -- [SUCCESS] Exported EML files from piler --${norm}\n" \
|
||||
"$(stamp)" >> "$logFile"
|
||||
else
|
||||
if ! ${pilerExport} -a "$exportStart" -b "$exportEnd" 2>>"$logFile"; then
|
||||
if ! pilerexport -a "$exportStart" -b "$exportEnd" 2>>"$logFile"; then
|
||||
exitError 115 "There was a problem while exporting EML from piler"
|
||||
fi
|
||||
printf "${ok}[%s] -- [SUCCESS] Exported EML files from piler --${norm}\n" \
|
||||
@ -648,7 +637,6 @@ exit 0
|
||||
# 1: parameter error
|
||||
# 2: not run as root
|
||||
# 3: borg not installed
|
||||
# 4: cannot find pilerexport executable
|
||||
# 99: TERM signal trapped
|
||||
# 111: could not create tmp dir for EML dump from piler-export
|
||||
# 112: could not set permissions on tmp dir
|
||||
|
Loading…
Reference in New Issue
Block a user