⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 __inc_link

📁 一套客户/服务器模式的备份系统代码,跨平台,支持linux,AIX, IRIX, FreeBSD, Digital Unix (OSF1), Solaris and HP-UX.
💻
字号:
#!/bin/sh################### Start of $RCSfile: __inc_link,v $ #################### $Source: /home/alb/afbackup/afbackup-3.3.8.1/RCS/__inc_link,v $# $Id: __inc_link,v 1.2 2004/07/08 20:34:42 alb Exp alb $# $Date: 2004/07/08 20:34:42 $# $Author: alb $######### description #######################################################################################################################silent=0if [ _"$1" = "_-s" ] ; then  silent=1  shift 1fiif [ $# -ne 2 -a $# -ne 3 ] ; then  echo usage: `basename $0` '[ -s ] <symlink> <increment> [ <maxrotate> ]' >&2  exit 1fimaxrotate=""if [ $# -eq 3 ] ; then  maxrotate="$3"fic=`ls -ld $1|cut -c1`if [ _"$c" != "_l" ] ; then  if [ $silent -eq 0 ] ; then    echo "Error: $1 is not a symbolic link." >&2  fi  exit 2fiAWK=""# the solaris awk is doin' dawn f...... BSfor awk in nawk gawk awk ; do  for dir in `echo $PATH|tr : " "` ; do    if [ -x $dir/$awk ] ; then      AWK=$dir/$awk      break    fi  done  if [ _$AWK != _ ] ; then    break  fidoneif [ _$AWK = _ ] ; then  if [ $silent -eq 0 ] ; then    echo 'No awk ? Is this really a lovely UNIX ?' >&2    echo 'Sorry. I have to exit.' >&2  fi  exit 1fipoints_to=`/bin/ls -l $1|$AWK '{print $NF}'`first_c=`echo "$points_to"|cut -c1`if [ _"$first_c" != _/ ] ; then  points_to=`dirname $1`/"$points_to"fitrailing_num=`echo "$points_to"|$AWK '{p=match($0,"[0-9]+$");if(p<1)print 0;else print substr($0,p)}'`base=`echo "$points_to"|$AWK '{p=match($NF,"[0-9]+$");if(p<1)print $0;else print substr($0,1,p-1)}'`if [ -d $points_to ] ; then  points_to_type=dfiif [ -f $points_to ] ; then  points_to_type=ffinew_num=`expr $trailing_num + $2`if [ _"$maxrotate" != _ ] ; then  new_num=`expr '(' '(' $new_num - 1 ')' % $maxrotate ')' + 1`fiEST=0if [ ! -f "$base""$new_num" -a ! -d "$base""$new_num" ] ; then  if [ _"$points_to_type" = _f ] ; then    bd=`basename "$base""$new_num"`    if [ ! -d $bd ] ; then      mkdir -p $bd \       && touch "$points_to"      EST=$?    fi  fi  if [ _"$points_to_type" = _d ] ; then    if [ ! -d "$base""$new_num" ] ; then      mkdir -p "$base""$new_num"      EST=$?    fi  fifiif [ $EST -ne 0 ] ; then  echo "Error: Cannot create component to point to." >&2  exit 2fi/bin/rm -f $1ln -s "$base""$new_num" $1EST=$?if [ $EST -ne 0 ] ; then  if [ $silent -ne 1 ] ; then    echo "Error: Cannot create link." >&2  fi  exit $ESTfiif [ $silent -eq 0 ] ; then  echo "$base""$new_num"fiexit $EST

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -