引用:
下面是引用arbor于2006-02-21 09:31发表的:
谢谢楼上几位朋友。
我看了一下top朋友推荐的网页,介绍rsync使用的,我似乎应该用rsync -avz foo:src/bar /data/tmp来更新,可是Lupa的镜像里面FC4里面的文件日期基本都是21-May-2005,Updates里面的文件比较新,但是新文件有新的版本号,这样文件名也就不一样了,我是否应该用rsync -avz mirror.lupaworld.com:fedora/updates/4/i386/ /data/tmp来更新?这样原来的旧版本的文件能否删除?
能否请负责人写一个比较详细的心得或者给我解释一下,谢谢!
.......
使用--partial可以断点续传 --delete删除源服务器已删除的部分,建议使用-avuz这样是更新。
下面给出SANOOL更新ubntu的脚本
#!/bin/bash
# Set this to the location where you want to store the lock file.
LOCKFILE="/home/sanool/script/ubuntu/releases.lock"
if [ -f $LOCKFILE ]; then
echo "releases.lock exists, aborting..."
exit 1
fi
touch $LOCKFILE
# Be careful when using "--delete" because it will delete your directories/files
# if your directory is set incorrectly!
rsync -auv --delete --exclude *ppc* --exclude *powerpc* --exclude *sparc* --progress rsync://archive.ubuntu.com/ubuntu /home/sanool/ubuntu/archive >/home/sanool/script/ubuntu/logs/releases.log 2>&1
rm -f $LOCKFILE
date >> /home/sanool/script/ubuntu/logs/all.log