backup sh tar.gz
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
#!/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)