Saturday, January 21, 2017

Scripting example


1.  #backup path
     TIME=`date +%b-%d-%y`  this date format
     cd /home/amit/Desktop/a/   which path where first go dir
    tar -cvf backup-$TIME.tar *    I am creating file tar * denote all exiting file
                                                                       make tar


2.     #!/bin/bash
##date format
#NOW=(date +"%F")

#backup path
TIME=`date +%b-%d-%y`
SRCDIR=/home/amit/Desktop/a/

#tar -cvf backup-$TIME.tar
DESDIR=/home/amit/Desktop/c/

FILENAME=backup-$TIME.tar

tar -cvf $DESDIR$FILENAME $SRCDIR

 

No comments:

Post a Comment