I am looking for a script to automate swaret through cron. there are a couple of things that I would like it to do that I don't know how to do.
1. the script should check for a connection though eth0 (using DHCP, if that helps); if not then fail
2. limit the amount of bandwith swaret will use to 20 kb/s (not sure this is possible)
3. Run --update, --upgrade -a (that's the easy part)
The limit request is that I only have a broadband connection at work and I don't wan't to suck it all up (the office is only allocated for 100K, were non-profit!).
Thanks in advance for any advice!
1) you mean the script has to bring up eth0 ?
if so, you can call "/etc/rc.d/rc.inet1 eth0_start "
and "/etc/rc.d/rc.inet1 eth0_stop " to close the connection.
maybe after starting up, ping the server swaret needs to check the connection.
2)if you use a 2.6.13 kernel there is the possibility to set a max kb/sec for a certain ip
by using iptables-rules.
i don't know the ins and outs, but it's there.
3)just type the commands in the script.
4) i really wouldn't run swaret or any autopackage-manager through a cronjob.
( i myself never use them )
if you just update without at least taking a quick look at the changelog,
some things might brake.
it's a bad idea...
I thought about this for a bit a while back and it just isn't worth the effort. Slackware does not need to be updated frequently enough to even think about a cron job. If you are really worried about getting updates then subscire your cell phone to the update mailing list or something. Instead of a cron job set
as your home page and run swaret first thing in the morning if you need to.
|All times are GMT -5. The time now is 04:51 PM.|