LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware Current using rsync (https://www.linuxquestions.org/questions/slackware-14/slackware-current-using-rsync-214958/)

equilibrium 08-08-2004 07:48 AM

Slackware Current using rsync
 
I was told that it is possible to keep up with slackware-current using rsync, would anyone by any chance know how that is done?
Thanks

spurious 08-08-2004 10:13 AM

I found this after googling "slackware current rsync" (2nd page): a script to update your slackware-current tree using rsync. I'm reproducing it below for the record, in case the original site is no longer available. DISCLAIMER: I have not used this script, and cannot offer support for it; you might want to contact the author.

Also, I suggest not using ftp.slackware.com as a server; choose a mirror server instead. You can find a list of mirrors at www.slackware.com. Personally, I use www.slackware.at

Code:

# This script should (theoretically) update the slackware-current tree
# using rsync, copy the correct directories to the iso tree, build an iso
# image of the iso tree, and then delete the iso tree.
# This script was written by Chris Dellicker (volthead@yahoo.com)

# 12/26/02 The above description is a bit old and outdated.  Read the script
# to find out exactly what it does.  It still builds an ISO of
# slackware-current, and keeps an up-to-date local tree of same, just does
# it a bit differently (and better) than it used to.

#This sets variables to be used by the script
SLACK=/slack                                #slackware-current directory
ISO=/slackiso                                #iso directory
BACKUP=/slackbackup                    #path to backup files to
DATE=`date +%m%d%y%H%M`                        #current date (MMDDYYHHmm)


# This says which server to use.  Comment out the one(s) you don't want.

#SERVER=ftp.slackware.com
SERVER=carroll.cac.psu.edu

case "$1" in
  -s)
      case "$2" in
        a)
            SERVER=ftp.slackware.com
            ;;
        b)
            SERVER=carroll.cac.psu.edu
            ;;
        *)
            SERVER=$2
            ;;
      esac
esac

# Before we do anything else, check to see if we need to update everything,
# or if it's already up to date.


# Initialize $LASTCHANGE to avoid an error message in case ChangeLog.txt
# is non-existant, as in the case where an update is forced by
# `rm ChangeLog.txt`.
LASTCHANGE=0

# To do this, we get the date of ChangeLog.txt that we already have.
LASTCHANGE=`date -r $SLACK/ChangeLog.txt +%s`

# Next, we have to find out what the date of the current ChangeLog.txt is.
# To do this, we first download it.

rsync -vvzPtb --backup-dir=$BACKUP --delete --stats $SERVER::slackware\
/slackware-current/ChangeLog.txt $SLACK/

# Now we compare $LASTCHANGE to the date of the new ChangeLog.txt.  If
# they match, we print out a message and exit.
if [ $LASTCHANGE = `date -r $SLACK/ChangeLog.txt +%s` ]; then
  if [ -f $ISO/*.iso ]; then
    echo
    echo "<<<<<<<<<<<<<<<<<<<<<*>>>>>>>>>>>>>>>>>>>>>"
    echo
    echo "    Your mirror is already up to date."
    echo
#    echo " Renaming your ISO image to $DATE.iso"
    echo "<<<<<<<<<<<<<<<<<<<<<*>>>>>>>>>>>>>>>>>>>>>"
    echo
#    mv $ISO/*.iso $ISO/$DATE.iso
    exit
  else
    echo
    echo "<<<<<<<<<<<<<<<<<<<<<*>>>>>>>>>>>>>>>>>>>>>"
    echo "    Your mirror appears up to date,"
    echo "    but something BAD happened!!!!!"
    echo "            You have no ISO!"
    echo "<<<<<<<<<<<<<<<<<<<<<*>>>>>>>>>>>>>>>>>>>>>"
    echo
  fi
fi

# That's it.  Now, if our mirror is not current, we go update the
# whole thing.  Also, if something BAD happened, we go update the
# whole thing just to make sure it's all current.  Then we make
# the ISO.

# This makes sure our directories are in place and $ISO is empty.
rm -rf $ISO
mkdir $ISO

rsync -arvvP -b --backup-dir=$BACKUP --delete --stats --exclude "/source/" \
--exclude "/pasture/" $SERVER::slackware/slackware-current/ $SLACK/

# This next var is the last changed date, taken from the most recent
# timestamp in the ChangeLog.txt file.  Added 11/16/02

CHGDATE=`date -d"\`grep -m1 " " $SLACK/ChangeLog.txt\`" +%m%d%y%H`

# next line:  Changed $DATE to $CHGDATE on 11/16/02 to reflect the last
# changed date of the distribution instead of the last time the image was
# created.

mkisofs -o $ISO/$CHGDATE.iso \
-R -J -V "Slackware 9.0b Install $CHGDATE" \
-x bootdisks \
-x extra \
-x kdei \
-x *.s \
-x pasture \
-x source \
-x backup \
-x jfs.i \
-x lowmem.i \
-x old_cd.i \
-x pportide.i \
-x speakup.i \
-x usb.i \
-x xfs.i \
-x xt.i \
-hide-rr-moved \
-v -d -N -no-emul-boot -boot-load-size 4 -boot-info-table \
-sort $SLACK/isolinux/iso.sort \
-b isolinux/isolinux.bin \
-c isolinux/isolinux.boot \
-A "Slackware Install CD" $SLACK

#-x ./bootdisks/*.s \
#-v -d -N -no-emul-boot -boot-load-size 128 -boot-info-table \
# Below options seem to be used by Debian:
# -T (TRANS.TBL)
# -r (instead of -R)
# -cache-inodes
# "-x t \"  will get rid of the t series, which is tetex.

# Just for good measure, we put the most recent ChangeLog.txt in
# the $ISO directory.

cp $SLACK/ChangeLog.txt $ISO/ChangeLog.txt

# That's it.  We're done. Simple, really.


Cedrik 08-08-2004 10:20 AM

Now I know why some ISO's files downloaded from sites fail ;)

Hey, I am kidding...I didn't know they were made on the fly.

spurious 08-08-2004 11:18 AM

That's why I just stick to the canonical release, and update using slapt-get. Actually, I haven't gotten around to upgrading from Slackware 9.0 to Slackware 10; I guess that's why they call it Slackware.

equilibrium 08-08-2004 11:39 AM

spurious thanks for your help, just wanted to mention that slapt-get can ruin your system :)

Mephisto 08-08-2004 12:50 PM

Quote:

Originally posted by equilibrium
spurious thanks for your help, just wanted to mention that slapt-get can ruin your system :)
Though I am an advocate of updating by hand instead of automated tools, slapt-get is less likely to break your install than swaret. Especially if you use --download-only.


All times are GMT -5. The time now is 02:31 PM.