LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 09-06-2012, 03:06 AM   #1
elexwave
LQ Newbie
 
Registered: Sep 2012
Distribution: Slackware
Posts: 7

Rep: Reputation: Disabled
Post rsync slackware current


Hello LQ,
I just installed Slackware Current in my box. I have the problem to update the system cause limited bandwidth. So I extract the slackware-current ISO to create a local repo. my ISO was updated on 24 August. It's first time when I use rsync. whether the option of rsync can meet these needs :
- If the same file not deleted.
- If the same file but the date or size is different then removed and replaced (for downloading files rebuild slackware current).
- If there is a new file then the old file is deleted and replaced.

I want rsync to perform updates only the necessary packages. :?
thanks in advance

Last edited by elexwave; 09-06-2012 at 07:07 PM. Reason: repair title
 
Old 09-06-2012, 03:16 AM   #2
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,498

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
to sync a slackware current via rsync I usually use this syntax (choose the rsync mirror you prefeer and the local path to the slackware-current tree)
Code:
rsync -avP --delete-after rsync://ftp.osuosl.org/slackware/slackware-current/ /data/slackware/slackware-current
but maybe it's better for you to use Alien BOB's mirror-slackware-current shell script, it has many features (read it for easy instructions).
 
Old 09-06-2012, 04:43 AM   #3
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963
If you have no nearby/fast rsync mirrors, you could use lftp instead to achieve the same kind of effect, like so:

Code:
lftp -c 'open http://mirrors.slackware.com/slackware/; mirror -enx ".*\.mirrorlist" slackware-current'
 
Old 09-06-2012, 05:50 AM   #4
elexwave
LQ Newbie
 
Registered: Sep 2012
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: Disabled
I create mirror for direct local access slackpkg, not to make an iso file. I want rsync just fetch some packages when it changed. can I do it?

Last edited by elexwave; 09-06-2012 at 05:57 AM. Reason: my english, :(
 
Old 09-06-2012, 06:04 AM   #5
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963
yes
 
Old 09-06-2012, 06:27 AM   #6
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,656

Rep: Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233
I use the same command as ponce for that. Just add the -z option to compress files during the transfer, as you have a limited bandwidth:
rsync -avzP --delete-after

Of course reading the manual to check the meaning of each and every option is a must, as applying blindly a receipt is always risky. This was implicit in previous responses

Last edited by Didier Spaier; 09-06-2012 at 06:34 AM.
 
1 members found this post helpful.
Old 09-06-2012, 07:06 AM   #7
elexwave
LQ Newbie
 
Registered: Sep 2012
Distribution: Slackware
Posts: 7

Original Poster
Rep: Reputation: Disabled
@ruario : come on guy, i'm in training.

@Didier Spaier : yes, its seems I must read a lot of manual program.

thanks to Ponce, ruario and Didier Spaier. It's my solution :
$ rsync -avzP --delete-after --delete \
--exclude "pasture" \
--exclude "source" \
--exclude "usb-and-pxe-installers" \
--exclude "extra" \
--exclude "isolinux" \
--exclude "kernels" \
--exclude "patches" \
--exclude "testing" \
--exclude "slackware64/kde" \
--exclude "slackware64/kdei" \
--exclude "slackware64/e" \
--exclude "slackware64/t" \
--exclude "slackware64/tcl" \
--exclude "slackware64/xap" \
rsync://ftp.osuosl.org/slackware/slackware-current/ /data/slackware/slackware-current

one by one, just rsync core of slackware.

Last edited by elexwave; 09-06-2012 at 07:49 AM. Reason: add solution
 
Old 09-06-2012, 08:10 AM   #8
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963
Quote:
Originally Posted by elexwave View Post
@ruario : come on guy, i'm in training.
Sorry, didn't mean to be so sarcastic. Ponce's answer was the right one though.
 
Old 09-06-2012, 08:12 AM   #9
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963
Quote:
Originally Posted by Didier Spaier View Post
I use the same command as ponce for that. Just add the -z option to compress files during the transfer
-z, yes very neat!
 
Old 09-06-2012, 08:32 AM   #10
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 242

Rep: Reputation: 86
rsync uses zlib for compression. Most files in slackware mirrors are already compressed with xz, and zlib can't compress them, it just eats some additional cpu cycles.
 
1 members found this post helpful.
Old 09-06-2012, 08:37 AM   #11
ruario
Senior Member
 
Registered: Jan 2011
Location: Oslo, Norway
Distribution: Slackware
Posts: 1,902

Rep: Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963Reputation: 963
Quote:
Originally Posted by Petri Kaukasoina View Post
rsync uses zlib for compression. Most files in slackware mirrors are already compressed with xz, and zlib can't compress them, it just eats some additional cpu cycles.
Ah yes, another good point! The various text files will compress. Though none of them are that big, so I agree the benefits if any will probably be negligible.
 
Old 09-06-2012, 09:57 AM   #12
Petri Kaukasoina
Member
 
Registered: Mar 2007
Posts: 242

Rep: Reputation: 86
ok, I measured it. I transferred the slackware64-current directory (5.4GB) from an rsync server to another machine. Default configuration in both ends. Without -z the client received 5684687767 bytes and with -z it received 5674708207 bytes. So -z helps but only 0.18 percent.

Without compression the rsyncd server process used 22s cpu time and with compression 184s. That's why compression actually slows down the transfer if the connection has a large bandwidth: I have a 1Gb/s connection and it took 93s real time without compression and 230s with compression.
 
1 members found this post helpful.
Old 09-06-2012, 03:27 PM   #13
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 227Reputation: 227Reputation: 227
You can also use
Code:
--exclude-from="exclude.list"
and just list all the excludes in exclude.list like this.
Code:
pasture/
source/
usb-and-pxe-installers/
extra/
etc.

Always good to let rsync know you intend to match directories only by including the trailing slash on the directory names too.
 
1 members found this post helpful.
Old 09-06-2012, 07:03 PM   #14
Franklin
Senior Member
 
Registered: Oct 2002
Distribution: Slackware, WinXP, Windows 7
Posts: 1,253

Rep: Reputation: 55
I've used the following for years:

Code:
#!/bin/bash
#
# Check slackware-current
#

# Where to download from
# should script it so that the different sources can be listed and
# selected from the command line

SOURCE="rsync://rsync.osuosl.org/slackware/slackware-current/"

# Change as necessary

OPTIONS="-avzP --delete --delete-after"
EXCLUDE="--exclude=pasture --exclude=kdei \
--exclude=zipslack --exclude=source --exclude=testing/source \
--exclude=extra/source"

DEST="/home/slackware/slackware-current"

case "$1" in

 "-c" )
 echo "Checking..."
 /usr/bin/rsync $OPTIONS $EXCLUDE --dry-run $SOURCE $DEST
 ;;

 "-d" )
 echo "Downloading..."
 /usr/bin/rsync $OPTIONS $EXCLUDE $SOURCE $DEST
 ;;
 
 * )
 echo "Usage: `basename $0` {-c|-d}"
 echo -e "\t-c : Check for updates"
 echo -e "\t-d : Download updates"
 exit
 ;;

esac
check-current -c is a dry run

check-current -d downloads the new files and deletes the replaced files.

Last edited by Franklin; 09-06-2012 at 07:07 PM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] setup fails on most current Slackware-current March 26, 2012 AlleyTrotter Slackware 15 04-09-2012 07:05 AM
[SOLVED] Script to build always a current ISO image of Slackware (slackware-current) robertjinx Slackware 2 12-09-2010 03:00 AM
Slackware64 -current vs Slackware -current or Slackware onebuck Slackware 16 06-23-2009 02:19 PM
slackware current question on the current kernels davimint Slackware 3 06-03-2007 08:39 AM
DISCUSSION: Upgrade to Slackware -current without a -current CD truthfatal LinuxAnswers Discussion 0 09-19-2006 02:42 PM


All times are GMT -5. The time now is 11:44 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration