LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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-11-2005, 08:49 AM   #1
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware, OpenBSD, FreeBSD
Posts: 728

Rep: Reputation: 168Reputation: 168
how do I rsync & cron to fetch -current weekly?


I'd like to set up my box to download everything in slackware-current say once a week, but I want to exclude certain directories in -current, like zipslack, kde internationalizations, etc. I have not done much bash coding, cron job scripting, or anything like that, but i figure there must be a way to write a bash script and then set a cron job or something to execute the script once a week or so. Or maybe there is an rsync daemon or something that can run in the background? I have no idea.

So, if you have any tips, pointers, scripts etc. to suggest, I would be very grateful.

Thanks!
 
Old 09-11-2005, 09:30 AM   #2
nukey
Member
 
Registered: Dec 2004
Location: Netherlands
Distribution: Slackware
Posts: 173

Rep: Reputation: 30
The proper way to do it is with rsync. (downloading it over and over again takes to long and is pretty useless)

You could make a script that rsyncs slackware current , and put the script in /etc/cron.weekly
(don't forget to "chmod +x" the script you created, in fact it isn't really a script, just one single-line command)

man rsync (for how to use rsync, --exclude etc is also explained there)

Or try using google and search for "rsync slackware" or something like that.

Last edited by nukey; 09-11-2005 at 09:32 AM.
 
Old 09-11-2005, 09:44 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,259

Rep: Reputation: Disabled
Hi!

I have a script called rsync_current.sh online at my site which does exactly that: make a mirror of the Slackware -current tree using rsync.
You can use it to mirror other Slackware releases as well (read the header message inside the script). The only thing you have to edit in the script before running it, is the value of the TOPDIR variable, to let it point to the directory where you want to have your mirrored directory tree.

You can add a line to your crontab (by running "crontab -e") like this (copy the script to /usr/local/bin):

Code:
# Keep the Slackware -current tree in sync:
45 5 * * sun      /usr/local/bin/rsync-current.sh
And it will re-sync your local mirror every sunday night at 05:45.

If you want to exclude, say, zipslack, you can edit the script (add --exclude "zipslack/*" to the rsync command), or run the unmodified script like this:

Code:
rsync_current.sh --exclude "zipslack/*"
Cheers, Eric
 
Old 09-11-2005, 10:07 AM   #4
chess
Member
 
Registered: Mar 2002
Location: 127.0.0.1
Distribution: Slackware, OpenBSD, FreeBSD
Posts: 728

Original Poster
Rep: Reputation: 168Reputation: 168
Wow, thanks for all the great responses! Eric, thank you very much for sharing your script. That's awfully nice of you.

Cheers, everyone!
 
  


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
Apache crash on cron->logrotate (weekly) pezzer55 Linux - Software 7 09-30-2008 07:58 PM
cron weekly does not run jordanthompson Linux - Software 21 01-16-2005 09:52 AM
using rsync with cron & pub. key kmitz Fedora 0 01-14-2005 08:01 AM
Weekly Cron problem sopiaz57 Linux - General 2 11-15-2004 11:46 AM
rsync and slackware-current nikko Slackware 13 06-07-2004 08:49 AM


All times are GMT -5. The time now is 07:38 PM.

Main Menu
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