auto cvsup

Paul Horechuk phorechuk at docucom.ca
Mon Jun 27 13:15:40 GMT 2005


There is another alternative to just doing the cvsup...

Kövesdán Gábor wrote:
> Maher Mohamed wrote:
> 
>> how can i upgrade my cvsup weekly with an auto way?
>>
>>  
>>
> You should use crondaemon. Place the following line to the end of 
> /etc/crontab:
> 
> 15      4       *       *       6       root    cvsup /some/path/to/supfile
> 
> The number six represents the sixth day of the week, the 15 is the 
> minute number and the second is the hour, thus this will run on every 
> Friday (if I remember correctly, I'm not sure the numbering starts with 
> Sunday) at 4:15.

This is an essential part, but I decided to take the next step. Not only 
do I get the updated cvsup, but I check for changes...

cvsup -l  (as root)
0 21 * * * /usr/local/bin/getupdates > /var/log/updates.log 2> 
/tmp/updates.err

This runs daily at 9pm with a log of the activity in 
/var/log/updates.log and an error report in /tmp/updates.err

getupdates: (set this as executable chmod 755)

#!/bin/sh
# get the updated sources
cd /usr/src
/usr/local/bin/cvsup -g stable-supfile
# get the updated ports tree
cd /usr/ports
/usr/local/bin/cvsup -g ports-supfile
# get the updated ports index
make fetchindex
# rebuild the list of changes, i.e. ports that have updates available
/usr/sbin/pkg_version -v | grep "<" > updates
exit 0

In the morning I simply go to the ports directory and issue:

more updates

to find out which ports have been affected. I can then use portupgrade 
<portname> as required.
As a bonus, I can also run getupdates at any time to recheck the updates.

> 
> Cheers,
> 
> Gábor Kövesdán
>


More information about the freebsd-stable mailing list