一个同步arch repo的脚本
来源:互联网 发布:程序员客栈官网招聘 编辑:程序博客网 时间:2024/06/05 11:54
#照葫芦画瓢,照着ubuntu同步脚本 写的
最近想同步arch的repo,发现rsync很不错,写了脚本记在这里,以后丢了可以再这里找到。
sync.sh
============
#!/bin/bash
[[ $UID == 0 ]] || { echo "Must be root run this script.";exit 0; }
LOCK="lock"
LOG="log.sync"
if [ -f $LOCK ]; then
echo "another sync is running ...,exiting !"
exit 1
fi
touch $LOCK
echo -e "/nStart sync @ `date `"|tee -a $LOG
echo -e "FROM rsync://mirror.rit.edu/archlinux/"|tee -a $LOG
echo "======================================"|tee -a $LOG
#================================================================
st=`date +%s`
rsync -avzP --delete --progress --exclude=".~tmp~" --delete-excluded rsync://mirror.rit.edu/archlinux/core/os/i686/ core/os/i686
ret=$?
if [ $ret -eq 0 ]; then
echo "Rsync core all succ"|tee -a $LOG
et=`date +%s`
echo "Sync core use $(( $et-$st )) sec = $(( ($et-$st)/60 )):$(( ($et-$st)%60 ))" | tee -a $LOG
else
echo "sync core failed " $ret |tee -a $LOG
fi
st=`date +%s`
rsync -avzP --delete --progress --exclude=".~tmp~" --delete-excluded rsync://mirror.rit.edu/archlinux/community/os/i686/ community/os/i686
ret=$?
if [ $ret -eq 0 ]; then
echo "Rsync community all succ"|tee -a $LOG
et=`date +%s`
echo "Sync community use $(( $et-$st )) sec = $(( ($et-$st)/60 )):$(( ($et-$st)%60 ))" | tee -a $LOG
else
echo "sync community failed " $ret |tee -a $LOG
fi
st=`date +%s`
rsync -avzP --delete --progress --exclude=".~tmp~" --delete-excluded rsync://mirror.rit.edu/archlinux/extra/os/i686/ extra/os/i686
ret=$?
if [ $ret -eq 0 ]; then
echo "Rsync extra all succ"|tee -a $LOG
et=`date +%s`
echo "Sync extra use $(( $et-$st )) sec = $(( ($et-$st)/60 )):$(( ($et-$st)%60 ))" | tee -a $LOG
echo "Sync OK .../n"|tee -a $LOG
else
echo "Sync extra Failed .../n" $ret |tee -a $LOG
fi
#================================================================
rm $LOCK
- 一个同步arch repo的脚本
- repo同步存在的问题
- Android的代码同步repo
- Android的代码同步repo
- 实现一个文件夹同步的shell脚本
- 一个同步ubuntu源的脚本。。。
- repo同步
- android下载脚本repo的新地址
- 共享一个同步ftp脚本
- 一个两台机子同步文件的脚本
- 基于七牛Python SDK写的一个同步脚本
- 一个简单的循环rsync是否同步完成脚本
- 如何申请一个新的repo
- repo同步android源码
- arch linux 时钟同步服务
- repo git 同步超大的工程太慢的解决方法
- 根据不同的manifest.xml使用repo同步代码
- Repo脚本分析
- svn 更新不了
- 不要一辈子靠技术混饭吃
- 关于编程的理解-【学习札记】
- 使用JDBC连接虚拟机数据库时遇到的问题
- jsp页面数据导入word
- 一个同步arch repo的脚本
- Windows.Forms.ImageLayout
- 最近遇到一个很蹩脚的问题
- 【15天學會jQuery】-----第7天
- 在Windows Live Writer配置CSDN博客
- .net 输出文件到客户端并删除
- 瑞泰lcd
- js鼠标事件大全
- 【15天學會jQuery】-----第8天