1 |
Maybe this is old news? |
2 |
|
3 |
I have written a quick little script to help prevent a server from syncing its |
4 |
portage tree more than once per 24 hours. Syncing more frequently is more |
5 |
likely to happen on a server with multiple admins, so instead of keeping |
6 |
track of when anyone syncs the tree we now just use this little script. We |
7 |
use esearch instead of calling emerge directly but the script can be adjusted |
8 |
very easily. |
9 |
|
10 |
If anyone has come up with a better way to do this, I'd love to see it. |
11 |
|
12 |
jus@kronos ~ # cat /usr/sbin/esync2 |
13 |
#!/bin/bash |
14 |
|
15 |
file=`find /tmp/esync.update -mtime +1` |
16 |
|
17 |
if [ -z $file ]; then |
18 |
|
19 |
echo 'Portage update has already been run within the last 24 hours.' |
20 |
echo 'Please try again later.' |
21 |
|
22 |
else |
23 |
|
24 |
echo 'The local portage tree is more than 24 hours old.' |
25 |
echo '/usr/sbin/esync will now run, this will take at least several minutes to |
26 |
complete' |
27 |
/bin/touch /tmp/esync.update |
28 |
/usr/sbin/esync |
29 |
/bin/touch /tmp/esync.update |
30 |
|
31 |
fi |
32 |
-- |
33 |
gentoo-server@g.o mailing list |