ITPub博客

首页 > Linux操作系统 > Linux操作系统 > linux 下sync增量备份

linux 下sync增量备份

原创 Linux操作系统 作者:bontonpan 时间:2009-01-30 10:18:26 0 删除 编辑
!/bin/sh
     
       #/bin/rm -rf /mnt/hd20/*
       #/bin/cp -af /bin /boot /dev /etc /initrd /lib /opt /root /sbin /tmp /usr /var /mnt/hd20
     
       for aa in `date +%w`
       do
               case "$aa" in
               '1') BACKUPDIR="/mnt/hd01/1";
                   BACKUPHDD="hd01";;
              '2') BACKUPDIR="/mnt/hd01/2";
                   BACKUPHDD="hd01";;
              '3') BACKUPDIR="/mnt/hd01/3";
                   BACKUPHDD="hd01";;
              '4') BACKUPDIR="/mnt/hd01/4";
                   BACKUPHDD="hd01";;
              '5') BACKUPDIR="/mnt/hd01/5";
                  BACKUPHDD="hd01";;
             '6') BACKUPDIR="/mnt/hd01/6";
                  BACKUPHDD="hd01";;
             '0') BACKUPDIR="/mnt/hd01/0";
                  BACKUPHDD="hd01";;
            BACKUPDIR="current";;
            esac
            done
 SERVER_PATH="cnsrv158:/mnt/cnsrv155"
 BACKUP_PATH="/mnt/hd01/backup/cnsrv155"
/usr/bin/rsync -rvlHpogDtS --delete --ignore-errors -e "ssh -p 22" "$SERVER_PATH/Assy" $BACKUP_PATH
     /usr/bin/rsync -rvlHpogDtS --delete --ignore-errors -e "ssh -p 22" "$SERVER_PATH/Barcode" $BACKUP_PATH
     /usr/bin/rsync -rvlHpogDtS --delete --ignore-errors -e "ssh -p 22" "$SERVER_PATH/CM" $BACKUP_PATH
     33 /usr/bin/rsync -rvlHpogDtS --delete --ignore-errors -e "ssh -p 22" "$SERVER_PATH/Cutoms" $BACKUP_PATH
     34 /usr/bin/rsync -rvlHpogDtS --delete --ignore-errors -e "ssh -p 22" "$SERVER_PATH/D9SCM" $BACKUP_PATH
     35 /usr/bin/rsync -rvlHpogDtS --delete --ignore-errors -e "ssh -p 22" "$SERVER_PATH/DCC" $BACKUP_PATH
     36 /usr/bin/rsync -rvlHpogDtS --delete --ignore-errors -e "ssh -p 22" "$SERVER_PATH/ED" $BACKUP_PATH
su postgres -c 'bb=`date +%Y%m%d`; pg_dump mrp > "/mnt/hd01/backup/mpe_db_$bb.txt"'

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11754813/viewspace-544773/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 没有了~
下一篇: linux fstab configure
请登录后发表评论 登录
全部评论

注册时间:2009-01-30

  • 博文量
    52
  • 访问量
    36708