#!/usr/bin/haserl -u -U /var/tmp Content-Type: application/x-gzip Content-Disposition: attachment; filename="var_flash.tar.gz" /dev/null 2>&1 # Create empty temp-dir for backup export BACKUP_DIR='var_flash' > /dev/null 2>&1 rm -rf $BACKUP_DIR > /dev/null 2>&1 mkdir $BACKUP_DIR > /dev/null 2>&1 # Create temporary copies of those character streams in /var/flash for file in $(ls /var/flash); do cat /var/flash/$file > $BACKUP_DIR/$file 2> /dev/null done # Create backup and send it to client via stdout tar cz $BACKUP_DIR/ 2> /dev/null # Clean up rm -rf $BACKUP_DIR > /dev/null 2>&1 ?>