Check for tempbackup

This commit is contained in:
Bob Mottram 2015-09-13 14:19:06 +01:00
parent f3dc1e33a9
commit c69ae249a6
1 changed files with 2 additions and 6 deletions

View File

@ -2424,13 +2424,13 @@ function backup_directory_to_usb {
echo 'if [ ! "$?" = "0" ]; then' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo " umount $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo " rm -rf $USB_MOUNT" >> /usr/bin/$BACKUP_SCRIPT_NAME
if [[ ${1} == "/root/temp"* ]]; then
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
echo " shred -zu ${1}/*" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo " rm -rf ${1}" >> /usr/bin/$BACKUP_SCRIPT_NAME
fi
echo ' exit 853' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup"* ]]; then
if [[ ${1} == "/root/temp"* || ${1} == *"tempbackup" ]]; then
echo "shred -zu ${1}/*" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo "rm -rf ${1}" >> /usr/bin/$BACKUP_SCRIPT_NAME
fi
@ -2759,7 +2759,6 @@ function create_backup_script {
echo ' fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo ' cp -f /home/$MY_USERNAME/README /home/$MY_USERNAME/tempbackup' >> /usr/bin/$BACKUP_SCRIPT_NAME
backup_directory_to_usb '/home/$MY_USERNAME/tempbackup' readme
echo ' rm -rf /home/$MY_USERNAME/tempbackup' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
@ -2777,7 +2776,6 @@ function create_backup_script {
echo " mkdir -p $USB_MOUNT/backup/mutt" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo ' fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
backup_directory_to_usb '/home/$MY_USERNAME/tempbackup' mutt
echo ' rm -rf /home/$MY_USERNAME/tempbackup' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
@ -2792,7 +2790,6 @@ function create_backup_script {
echo " mkdir -p $USB_MOUNT/backup/procmail" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo ' fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
backup_directory_to_usb '/home/$MY_USERNAME/tempbackup' procmail
echo ' rm -rf /home/$MY_USERNAME/tempbackup' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME
@ -2845,7 +2842,6 @@ function create_backup_script {
echo " mkdir -p $USB_MOUNT/backup/voip" >> /usr/bin/$BACKUP_SCRIPT_NAME
echo ' fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
backup_directory_to_usb '/home/$MY_USERNAME/tempbackup' voip
echo ' rm -rf /home/$MY_USERNAME/tempbackup' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo 'fi' >> /usr/bin/$BACKUP_SCRIPT_NAME
echo '' >> /usr/bin/$BACKUP_SCRIPT_NAME