#!/bin/bash
if [ -z "$1" ]
then
echo "No argument supplied"
exit
fi
BASENAME1=$(/bin/basename $1)
MYPATH1=$(/bin/pwd)
backupdir="$MYPATH1/backupdir"
mydate=$(date +"%m-%d-%y-%N")
if [ ! -d "$backupdir" ]; then
mkdir $backupdir
fi
cp $MYPATH1/$BASENAME1 $backupdir/$BASENAME1-$mydate
No comments:
Post a Comment