Don't need to duplicate error checking
This commit is contained in:
parent
179b3d1adb
commit
1d98ff06a8
|
@ -2418,19 +2418,20 @@ function get_mariadb_owncloud_admin_password {
|
||||||
function backup_directory_to_usb {
|
function backup_directory_to_usb {
|
||||||
if [[ $BACKUP_TYPE == 'rsync' ]]; then
|
if [[ $BACKUP_TYPE == 'rsync' ]]; then
|
||||||
echo "rsyncrypto -v -r ${1} $USB_MOUNT/backup/${2} $USB_MOUNT/backup/${2}.keys $BACKUP_CERTIFICATE" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo "rsyncrypto -v -r ${1} $USB_MOUNT/backup/${2} $USB_MOUNT/backup/${2}.keys $BACKUP_CERTIFICATE" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo 'if [ ! "$?" = "0" ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
fi
|
||||||
echo " umount $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
|
||||||
echo " rm -rf $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo 'if [ ! "$?" = "0" ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
if [[ ${1} == "/root/temp"* ]]; then
|
echo " umount $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo " shred -zu ${1}/*" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo " rm -rf $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo " rm -rf ${1}" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
if [[ ${1} == "/root/temp"* ]]; then
|
||||||
fi
|
echo " shred -zu ${1}/*" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo ' exit 853' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo " rm -rf ${1}" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
fi
|
||||||
if [[ ${1} == "/root/temp"* ]]; then
|
echo ' exit 853' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo "shred -zu ${1}/*" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
echo "rm -rf ${1}" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup"* ]]; then
|
||||||
fi
|
echo "shred -zu ${1}/*" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
|
echo "rm -rf ${1}" >> /usr/bin/$BACKUP_SCRIPT_NAME
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue