private void deleteOldBackups () {
        try {
            //
            File backupDir = new File(pSystem.getStringProperty(STRING_BACKUP_FOLDER));
            // get every zip file in the backup Dir
            File[] tempArray = backupDir.listFiles();
            File[] array = new File[tempArray.length - 1];
            for (int i = 0 , j = 0; i < tempArray.length ; ++i) {
                File file = tempArray[i];
                if (file.isDirectory() && file.getName().equals("custom"))
                    continue;
                array[j++] = tempArray[i];
            }
            tempArray = array;
            final int maxBackups = pSystem.getIntProperty(INT_MAX_BACKUPS);
            // when are more backups existing as allowed as to store
            if (tempArray.length > maxBackups) {
                System.out.println("Delete old backups");

                // Store the to delete backups in a list
                ArrayList<File> backups = new ArrayList<File>(tempArray.length);
                // For this add all backups in the list and remove later the newest ones
                backups.addAll(Arrays.asList(tempArray));

                // the current index of the newest backup
                int maxModifiedIndex;
                // the current time of the newest backup
                long maxModified;

                //remove all newest backups from the list to delete
                for (int i = 0 ; i < maxBackups ; ++i) {
                    maxModifiedIndex = 0;
                    maxModified = backups.get(0).lastModified();
                    for (int j = 1 ; j < backups.size() ; ++j) {
                        File currentFile = backups.get(j);
                        if (currentFile.lastModified() > maxModified) {
                            maxModified = currentFile.lastModified();
                            maxModifiedIndex = j;
                        }
                    }
                    backups.remove(maxModifiedIndex);
                }
                System.out.println("[BACKUP] Removing the following backups due to age:");
                System.out.println(Arrays.toString(backups.toArray()));
                // this are the oldest backups, so delete them
                for (File backupToDelete : backups)
                    backupToDelete.delete();
            }
        }
        catch (Exception e) {
            e.printStackTrace(System.out);
        }
    }