Re: Script help for updating routine
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/2/05, Denny White <[EMAIL PROTECTED]> wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have a script, pasted in below, which does various things on a daily basis, like cvsup src, docs, ports, portsdb, portversion, portupgrade, & so on. I finally figured out how to do the if/then/else thing with the portversion-portupgrade part of the script, but I can't figure out what to do to bypass the docs install part if there are no new docs. Thanks for any help I can get on it. Script follows: #!/bin/sh # echo "Cvsup latest src and doc" cvsup -g -L 2 /root/srcdoc-supfile # # THIS THE PART IN QUESTION, THAT DOES # DOES THE DOCS. CUSTOM MAKEFILE IS FOR # ENGLISH ONLY. #G #send copious output to the bit bucket echo "Updating docs" echo "" cd /usr/doc cp Makefile.custom Makefile make install #make install > /dev/null # cd /root echo "Portsnap fetching and updating ports" echo "" portsnap fetch portsnap update # echo "Updating INDEX in /usr/ports" echo "" cd /usr/ports #make fetchindex portsdb -uUF # echo "Portaudit checking for vulnerabilities in installed ports" echo "Results in file /root/vulnerable" echo "" portaudit -Fda >> /root/vulnerable # echo "Portversion checking if any ports need upgrading" echo "Results in file /root/need2upgrade" echo "" portversion -l "<" > /root/need2upgrade if grep '<' /root/need2upgrade; then echo "Portupgrade upgrading out-of-date ports" portupgrade -arR; else echo "Ports already up to date" 1>&2 exit 1 fi echo "Finished at `/bin/date`." exit Today Andrew P. contributed the following: 1. You can limit docs to custom languages in make.conf, that's a better way Yup, did it already. I had just copied it word for word to see how well it worked. Found it in Dru Lavigne's at OReilly. 2. You can affor to copy extra 60Mb once a day, can't you? Don't quite follow on that. It's all downloaded. Other langs aren't #'d out in the supfile, just aren't installed. Time consuming, not about h/d space. 3. You can grep cvsup output against something like "doc/" That's what I thought. Can't see grepping doc, maybe update? Don't know quite how, tho. Don't know enough about scripting yet, as I said. I don't want to interrupt the cvsup process. I thought about using tee & grep 'update' or something to that affect in that secondary output. 4. Never run portsnap fetch from cron, even if you chose a very odd time, use portsnap cron Yup, know about that, but thanks for the warning. I have it setup like you said, in cron, for times when I'm too lazy to run the entire script & instead, just do it piecemeal. GnuPG key : 0x1644E79A | http://wwwkeys.nl.pgp.net Fingerprint: D0A9 AD44 1F10 E09E 0E67 EC25 CB44 F2E5 1644 E79A -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (FreeBSD) Comment: Made with pgp4pine 1.76 iD8DBQFDal7vy0Ty5RZE55oRAtEcAJ9RJz3f7O6HXaL8KCAAPi4kn5cVewCgtASm qSJKDVKG3r7SDQ0PDfjk+kU= =nLco -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: Script help for updating routine
On 11/2/05, Denny White <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > > I have a script, pasted in below, which does various > things on a daily basis, like cvsup src, docs, ports, > portsdb, portversion, portupgrade, & so on. I finally > figured out how to do the if/then/else thing with the > portversion-portupgrade part of the script, but I can't > figure out what to do to bypass the docs install part > if there are no new docs. Thanks for any help I can > get on it. Script follows: > > #!/bin/sh > # > echo "Cvsup latest src and doc" > cvsup -g -L 2 /root/srcdoc-supfile > # > # THIS THE PART IN QUESTION, THAT DOES > # DOES THE DOCS. CUSTOM MAKEFILE IS FOR > # ENGLISH ONLY. > #G > #send copious output to the bit bucket > echo "Updating docs" > echo "" > cd /usr/doc > cp Makefile.custom Makefile > make install > #make install > /dev/null > # > cd /root > echo "Portsnap fetching and updating ports" > echo "" > portsnap fetch > portsnap update > # > echo "Updating INDEX in /usr/ports" > echo "" > cd /usr/ports > #make fetchindex > portsdb -uUF > # > echo "Portaudit checking for vulnerabilities in installed ports" > echo "Results in file /root/vulnerable" > echo "" > portaudit -Fda >> /root/vulnerable > # > echo "Portversion checking if any ports need upgrading" > echo "Results in file /root/need2upgrade" > echo "" > portversion -l "<" > /root/need2upgrade > if grep '<' /root/need2upgrade; then > echo "Portupgrade upgrading out-of-date ports" > portupgrade -arR; else > echo "Ports already up to date" 1>&2 > exit 1 > fi > echo "Finished at `/bin/date`." > exit > > GnuPG key : 0x1644E79A | http://wwwkeys.nl.pgp.net > Fingerprint: D0A9 AD44 1F10 E09E 0E67 EC25 CB44 F2E5 1644 E79A > > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.2 (FreeBSD) > Comment: Made with pgp4pine 1.76 > > iD8DBQFDaQ7Ny0Ty5RZE55oRAjYhAKCyDOKGhu86oAVu6Ml2ANf2Rt3vXwCfcs52 > 2V388qkRXw8Kiun8iR7rbiY= > =Wscs > -END PGP SIGNATURE- > > ___ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" > 1. You can limit docs to custom languages in make.conf, that's a better way 2. You can affor to copy extra 60Mb once a day, can't you? 3. You can grep cvsup output against something like "doc/" 4. Never run portsnap fetch from cron, even if you chose a very odd time, use portsnap cron 5. etc :) ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Script help for updating routine
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have a script, pasted in below, which does various things on a daily basis, like cvsup src, docs, ports, portsdb, portversion, portupgrade, & so on. I finally figured out how to do the if/then/else thing with the portversion-portupgrade part of the script, but I can't figure out what to do to bypass the docs install part if there are no new docs. Thanks for any help I can get on it. Script follows: #!/bin/sh # echo "Cvsup latest src and doc" cvsup -g -L 2 /root/srcdoc-supfile # # THIS THE PART IN QUESTION, THAT DOES # DOES THE DOCS. CUSTOM MAKEFILE IS FOR # ENGLISH ONLY. #G #send copious output to the bit bucket echo "Updating docs" echo "" cd /usr/doc cp Makefile.custom Makefile make install #make install > /dev/null # cd /root echo "Portsnap fetching and updating ports" echo "" portsnap fetch portsnap update # echo "Updating INDEX in /usr/ports" echo "" cd /usr/ports #make fetchindex portsdb -uUF # echo "Portaudit checking for vulnerabilities in installed ports" echo "Results in file /root/vulnerable" echo "" portaudit -Fda >> /root/vulnerable # echo "Portversion checking if any ports need upgrading" echo "Results in file /root/need2upgrade" echo "" portversion -l "<" > /root/need2upgrade if grep '<' /root/need2upgrade; then echo "Portupgrade upgrading out-of-date ports" portupgrade -arR; else echo "Ports already up to date" 1>&2 exit 1 fi echo "Finished at `/bin/date`." exit GnuPG key : 0x1644E79A | http://wwwkeys.nl.pgp.net Fingerprint: D0A9 AD44 1F10 E09E 0E67 EC25 CB44 F2E5 1644 E79A -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (FreeBSD) Comment: Made with pgp4pine 1.76 iD8DBQFDaQ7Ny0Ty5RZE55oRAjYhAKCyDOKGhu86oAVu6Ml2ANf2Rt3vXwCfcs52 2V388qkRXw8Kiun8iR7rbiY= =Wscs -END PGP SIGNATURE- ___ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"