After searched the internet and modified a script, I has the follow script to keep my local copy in sync with official update.
#!/bin/bash HOST="slackware.mirrors.tds.net" VERSION="current" LSLACKWARE="/home/ftp/slackware-$VERSION" LSLACKWARE64="/home/ftp/slackware64-$VERSION" SLACKWARE="/pub/slackware/slackware-$VERSION" SLACKWARE64="/pub/slackware/slackware64-$VERSION" COMMON_OPTIONS="mirror --delete \ --ignore-time \ --verbose \ --exclude-glob kernels/ \ --exclude-glob pasture/ \ --exclude-glob patches/ \ --exclude-glob source/" if [ ! -d $LSLACKWARE ]; then mkdir -p $LSLACKWARE fi if [ ! -d $LSLACKWARE64 ]; then mkdir -p $LSLACKWARE64 fi lftp -c "set ftp:list-options -a; set ftp:passive-mode true; open ftp://$HOST; lcd $LSLACKWARE; cd $SLACKWARE; $COMMON_OPTIONS" lftp -c "set ftp:list-options -a; set ftp:passive-mode true; open ftp://$HOST; lcd $LSLACKWARE64; cd $SLACKWARE64; $COMMON_OPTIONS"Reference: How to use rsync over FTP
No comments:
Post a Comment