backup sh tar.gz

By | 7th April 2015
#!/bin/bash
#Purpose = Backup of Important Data
#Created on 17-1-2012
#Author = Hafiz Haider
#Version 1.0
#START

TIME=`date +%b-%d-%y`            # This Command will add date in Backup File Name.
FILENAME=backup-$TIME.tar.gz    # Here i define Backup file name format.
SRCDIR=/var/log/                    # Location of Important Data Directory (Source of backup).
DESDIR=/home/harian           # Destination of backup file.
DESDIR1=/home
FILENAME1=harian.tar.gz
SRCDIR1=/home/harian
tar -C / -cpzf $DESDIR/$FILENAME $SRCDIR
tar -C / -cpzf $DESDIR1/$FILENAME1 $SRCDIR1
#END

tinggal save dengan (nama file).sh

chmod +x (namaf file)