LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   how do I rsync & cron to fetch -current weekly? (https://www.linuxquestions.org/questions/slackware-14/how-do-i-rsync-and-cron-to-fetch-current-weekly-362329/)

chess 09-11-2005 08:49 AM

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!

nukey 09-11-2005 09:30 AM

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.

Alien Bob 09-11-2005 09:44 AM

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

chess 09-11-2005 10:07 AM

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

Cheers, everyone!


All times are GMT -5. The time now is 06:24 PM.