You are here: Home, sweet home » Programming... » Scriplets  
 

Scriplets

Backup

#!/bin/sh
# Make a backup of the current directory in it's parent directory
# Filename looks like: 
HERE=`pwd`
DIR=`basename $HERE`
FILE=`date +%Y%m%d_%H%M%S`_$DIR.tgz
echo -n "Backup..."
cd ..
tar cfz $FILE $DIR
echo "size= `du -h $FILE`"
   
Last modified: 2009/10/05 13:12 Mijn Fijne Site hosting en design