X-Git-Url: https://hackdaworld.org/gitweb/?a=blobdiff_plain;f=fai_backup.sh;h=95d4327ec08161debc1c42a1d6ab5ec487fdcc83;hb=eadd953d72897302c90f17d371453132e8584441;hp=314f053271991b83408d2f698f9afa292a041d5a;hpb=83800cf60ee276c60104b99be50a927d021751c7;p=scripts%2Fscripts.git diff --git a/fai_backup.sh b/fai_backup.sh index 314f053..95d4327 100755 --- a/fai_backup.sh +++ b/fai_backup.sh @@ -4,7 +4,7 @@ configcp() { file=$1 mkdir -p $configdir/$file - cp -v $file $configdir/$file/$myip + rsync -av $file $configdir/$file/$myip } backupcp() { cat=$1 @@ -30,7 +30,11 @@ backupdir="/mnt/tmp2" # initializing custom variables host=`hostname` -myip="`host $host | awk '{ print $4 }'`" +if [ -z $1 ] ; then + myip="`host $host | awk '{ print $4 }'`" +else + myip=$1 +fi res=$? if [ "$res" != "0" ] ; then echo "unable to determine the hosts ip address" @@ -64,8 +68,8 @@ else fi # config: -for configfile in /usr/src/kernel/*config; do - configcp $configfile +for configfile in /usr/src/linux/.config; do + [ -f $configfile ] && configcp $configfile done for onefile in profile network kernel wireless; do configfile="/etc/conf/$onefile"